Skip to content
UPEEC

Integer Square Root

Medium#math#binary-search· solved by 0 · time limit 2.0 s

Print ⌊n⌋\lfloor \sqrt{n} \rfloor exactly. Floating-point sqrt can be off by one for huge nn — binary search on the answer instead.

Input

A single integer nn.

Output

⌊n⌋\lfloor\sqrt n\rfloor

Constraints

0≤n≤10180 \le n \le 10^{18}

Sample 1

Input

17

Output

4

Sample 2

Input

16

Output

4

Sign in or join free to run and submit your solution.