Problems
Number
Number
Find the largest natural number which does not exceed a given \textbf{M} and its decimal representation coincides with the last digit of the square.
\InputFile
A positive integer \textbf{M} (\textbf{1} ≤ \textbf{M} ≤ \textbf{1000000000}).
\OutputFile
The answer to the problem.
Input example #1
9
Output example #1
6