Contest: Task: Related: TaskB

Score : $300$ points

Find the maximum possible sum of the digits (in base $10$) of a positive integer not greater than $N$.

- $1\leq N \leq 10^{16}$
- $N$ is an integer.

Input is given from Standard Input in the following format:

$N$

Print the maximum possible sum of the digits (in base $10$) of a positive integer not greater than $N$.

100

18

For example, the sum of the digits in $99$ is $18$, which turns out to be the maximum value.

9995

35

For example, the sum of the digits in $9989$ is $35$, which turns out to be the maximum value.

3141592653589793

137