LogiQuest

493. Arranging Coins

EasyMathBinary Search

Row i of a staircase needs i coins. Print the number of complete rows you can build with n coins.

Input format

One integer n

Output format

The number of full rows.

Example 1

Input

5

Output

2

Example 2

Input

8

Output

3

Constraints

1 ≤ n ≤ 2³¹ − 1

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

Loading the MyLoginn IDE…