You are tasked with finding the maximum possible sum of the digits of a positive integer that is not greater than a given integer ( N ).
Input Format
A single integer ( N ) (1 ≤ ( N ) ≤ ( 10^9 )), which represents the upper limit of the positive integer for which you need to find the maximum digit sum.
Output Format
Output a single integer, which is the maximum sum of the digits of any positive integer that is less than or equal to ( N ).
Examples
Example 1
Input:
text
5
Output:
text
5
Example 2
Input:
text
15
Output:
text
6
Example 3
Input:
text
99
Output:
text
18
Example 4
Input:
text
100
Output:
text
9
Solution
Please place your solution in the /app/ directory.