#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 m2m^2 for some integer mm.

Given a very large natural number AA, the number of perfect squares from 11 through AA is ⌊A⌋\lfloor\sqrt A\rfloor.

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 5959, print 50; if it is 1234512345, print 10000.

Input

One line contains the decimal representation of the natural number AA.

Output

Print the number of perfect squares from 11 through AA in the requested approximate form: keep the first digit and replace all remaining digits by 0.

Subtasks

  • Subtask 1 (20%): 1≤A≤10181\le A\le10^{18}.
  • Subtask 2 (30%): AA has at most 100100 decimal digits.
  • Subtask 3 (50%): Full constraints: 1≤A≤1010001\le A\le10^{1000}.

Examples

Input

1000

Output

30

Explanation

The exact number of perfect squares not exceeding 10001000 is

⌊1000⌋=31.\lfloor\sqrt{1000}\rfloor=31.

The required format keeps the first digit of 31, namely 3, and replaces the remaining digit by 0. Therefore the program prints 30.