eolymp
bolt
Try our new interface for solving problems
Problems

Square Country 5

Square Country 5

The first arithmetical operation taught to the children of the Square country is the calculation of squares of positive integers. At the first lesson the children are provided with "easy" numbers, calculating a square of which can be done by writing a few digits in front of them (i.e. \textbf{76} --- is an easy number because \textbf{76^2 = 5776}). Of course, the numbers cannot contain leading zeroes. The task shouldn't be too difficult, so the easy numbers shouldn't contain more than \textbf{n} digits. How many different easy numbers can teachers prepare for the first lesson? \InputFile The only input line contains an integer \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{2000}), the maximal length of the easy number the children can be provided with. \OutputFile Output the number of different easy numbers consisting of at most \textbf{n} digits.
Time limit 2 seconds
Memory limit 16 MiB
Input example #1
1
Output example #1
3
Author Alex Samsonov
Source Ural SU Contest. Petrozavodsk Winter Session, February 2009