Number
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Find the largest natural number which does not exceed a given M and its decimal representation coincides with the last digit of the square.
Input
A positive integer M (1 ≤ M ≤ 1000000000).
Output
The answer to the problem.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 9%