Digits Sum

AtCoder
IDagc025_a
Time2000ms
Memory256MB
Difficulty
Takahashi has two positive integers $A$ and $B$. It is known that $A$ plus $B$ equals $N$. Find the minimum possible value of "the sum of the digits of $A$" plus "the sum of the digits of $B$" (in base $10$). ## Constraints * $2 ≤ N ≤ 10^5$ * $N$ is an integer. ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
15
Output #1
6

When $A=2$ and $B=13$, the sums of their digits are $2$ and $4$, which minimizes the value in question.
Input #2
100000
Output #2
10
API Response (JSON)
{
  "problem": {
    "name": "Digits Sum",
    "description": {
      "content": "Takahashi has two positive integers $A$ and $B$. It is known that $A$ plus $B$ equals $N$. Find the minimum possible value of \"the sum of the digits of $A$\" plus \"the sum of the digits of $B$\" (in bas",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "agc025_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Takahashi has two positive integers $A$ and $B$.\nIt is known that $A$ plus $B$ equals $N$. Find the minimum possible value of \"the sum of the digits of $A$\" plus \"the sum of the digits of $B$\" (in bas...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments