LogiQuest

156. Integer Square Root

EasyBinary Search

Print ⌊√n⌋ without using floating-point square root functions.

Input format

A single integer n.

Output format

⌊√n⌋

Example 1

Input

8

Output

2

Example 2

Input

0

Output

0

Constraints

0 ≤ n ≤ 10¹⁸

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…