#agc025a. [agc025_a]Digits Sum

[agc025_a]Digits Sum

Problem Statement

Takahashi has two positive integers AA and BB.

It is known that AA plus BB equals NN. Find the minimum possible value of "the sum of the digits of AA" plus "the sum of the digits of BB" (in base 1010).

Constraints

  • 2N1052 ≤ N ≤ 10^5
  • NN is an integer.

Input

Input is given from Standard Input in the following format:

NN

Output

Print the minimum possible value of "the sum of the digits of AA" plus "the sum of the digits of BB".


Sample Input 1

15

Sample Output 1

6

When A=2A=2 and B=13B=13, the sums of their digits are 22 and 44, which minimizes the value in question.


Sample Input 2

100000

Sample Output 2

10