e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

The maximum number

The maximum number

Find the maximum positive integer that does not exceed n, the sum of which digits is maximum.

Input

One positive integer n (1n2 147 483 647).

Output

One number - the answer to the problem.

Time limit 1 second
Memory limit 64 MiB
Input example #1
115
Output example #1
99
Фарбування доріжки