Максимум
Recently, a first grader learned to add numbers Vasya. It this process very much, and he puts everything in sight. When all the numbers are stacked around, Vasili turned to his older brother Pete for new numbers. After several appeals tired of working random number generator, Peter came up to Washi task that can also take a long time.
He suggested Vasya find the sum of digits of consecutive numbers — 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 — and so on, until Vasya not get bored. Vasya was enthusiastic about the idea and went to work. Yesterday Vasya find sum of digits of each of the numbers from 1 to 115. Looking at the results of his younger brother, Peter noticed that the sum of digits of consecutive numbers are not random, often they are consecutive, but the pattern completely, he did not understand.
To find the patterns, Peter decided to explore the extreme cases, for example, which of the numbers gives the maximum amount of digits. Data for the numbers to 115 was not enough for final conclusions, and Pete had the idea to speed up the calculations used in place of brother computer. As he himself programming is not very strong, he sought the solution of this problem to you.
Input
In the first line of input data is the number N (1 <= N <= 2 147 483 647).
Output
Remove a number from 1 to N inclusive, with the maximum amount of digits. If the numbers with a maximum sum of several numbers, display the greatest of them.