eolymp
bolt
Try our new interface for solving problems
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.
Time limit 1 second
Memory limit 64 MiB
Input example #1
9
Output example #1
6