Jumping Rabbit

0

0 votes
Problem

At time 0, a rabbit is standing at coordinate 0 on X-axis. During the ith second he can either stay at his position, or can jump i distance to the left or right.

He wants to reach at coordinate D. Find the minimum possible time to reach the destination.

Constraints

1 ≤ D ≤ 109

Input

Integer D

Output

Print the minimum possible time to reach the destination.

 

 

Sample Input
2
Sample Output
2
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

During 1st second:- Stay

During 2nd second:- Jump to the right

Editor Image

?