Not knowing which song was playing
Akie has a very old music player. The player can play $$$x$$$ songs in sequence and displays the number of songs remaining, denoted as $$$x'$$$, on the screen. Initially, $$$x' = x$$$. After each song finishes playing, $$$x'$$$ decreases by $$$1$$$ until it reaches $$$0$$$. However, the screen of this player is broken and can only show the most significant digit of $$$x'$$$; it cannot show the exact value or the number of digits of $$$x'$$$.
Akie does not know the exact value of $$$x$$$, but she can infer the value of $$$x$$$ based on the information shown on the screen. So, after how many songs must Akie wait at least to be sure of the value of $$$x$$$?
A line with a single integer $$$x$$$ ($$$10 \leq x \leq 10^6$$$).
Note: Akie does not know the upper bound of $$$x$$$; for her, $$$x$$$ could be any positive integer not less than $$$10$$$.
Output an integer representing the minimum number of songs Akie must wait to determine the value of $$$x$$$.
33
14
789
190
In the first example, initially Akie sees the digit $$$3$$$ on the screen, and it does not change after the first $$$3$$$ songs. Over the next $$$10$$$ songs, the digit on the screen becomes $$$2$$$, but at this point she cannot rule out numbers like $$$303$$$ or $$$3003$$$. After one more song, the digit on the screen becomes $$$1$$$, and then she can determine that $$$x$$$ is $$$33$$$.
| Name |
|---|


