AtCoder Grand Contest 025
A
Digits Sum
AtCoder
⌀ 0
原题
←B →
翻译中…

Problem Statement

翻译中…

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

翻译中…

Output

翻译中…

Print the minimum possible value of "the sum of the digits of $A$" plus "the sum of the digits of $B$".

翻译中…

样例

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
题目信息
题号
agc025_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。