#CCBCHMOT0000059. Căn bậc hai nguyên (Integer Square Root)

Căn bậc hai nguyên (Integer Square Root)

Integer Square Root

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given a nonnegative integer nn, find the greatest nonnegative integer kk satisfying k2≤nk^2\le n. This is the integer square root of nn; the answer must be exact rather than inferred from floating-point rounding.

Input

One line contains a nonnegative integer nn.

Output

Print the integer k=⌊n⌋k=\lfloor\sqrt n\rfloor.

Subtasks

  • Subtask 1 (20%): 0≤n≤1040\le n\le10^4.
  • Subtask 2 (30%): 0≤n≤1080\le n\le10^8.
  • Subtask 3 (50%): 0≤n≤10120\le n\le10^{12}.

Examples

Example 1

Input

26

Output

5

Explanation

52=25≤265^2=25\le26 while 62=36>266^2=36>26, hence the answer is 5.

Example 2

Input

0

Output

0

Explanation

02=0≤00^2=0\le0 but 12>01^2>0, so the answer is zero.

Example 3

Input

1000000000000

Output

1000000

Explanation

10000002=10121000000^2=10^{12}, giving the exact integer square root.