The maximum number
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Find the maximum positive integer that does not exceed n, the sum of which digits is maximum.
Input
One positive integer n (1 ≤ n ≤ 2 147 483 647).
Output
One number - the answer to the problem.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 8%