#MTH000000025. Số chính phương rất lớn (Very Big Perfect Squares)
Số chính phương rất lớn (Very Big Perfect Squares)
Very Big Perfect Squares
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
An integer is a perfect square if it has the form for some integer .
Given a very large natural number , the number of perfect squares from through is .
You do not have to print this value exactly. Keep only its most significant digit and replace every following digit by 0. For example, if the exact count is , print 50; if it is , print 10000.
Input
One line contains the decimal representation of the natural number .
Output
Print the number of perfect squares from through in the requested approximate form: keep the first digit and replace all remaining digits by 0.
Subtasks
- Subtask 1 (20%): .
- Subtask 2 (30%): has at most decimal digits.
- Subtask 3 (50%): Full constraints: .
Examples
Input
1000
Output
30
Explanation
The exact number of perfect squares not exceeding is
The required format keeps the first digit of 31, namely 3, and replaces the remaining digit by 0.
Therefore the program prints 30.