#agc025a. [agc025_a]Digits Sum
[agc025_a]Digits Sum
Problem Statement
Takahashi has two positive integers and .
It is known that plus equals . Find the minimum possible value of "the sum of the digits of " plus "the sum of the digits of " (in base ).
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum possible value of "the sum of the digits of " plus "the sum of the digits of ".
Sample Input 1
15
Sample Output 1
6
When and , the sums of their digits are and , which minimizes the value in question.
Sample Input 2
100000
Sample Output 2
10