Problems
10150 - Back And Forth Numbers
SUBMIT PROBLEM

Back And Forth Numbers

Time Limit: 1 sec

 

The Problem

One day, your little sister started to writing numbers starting from 2 in the following way:

 

   2  3  4  5
 9  8  7  6  
   10  11  12  13
 17  16  15  14  
   .  .  .  .

 

 

Seeing this, a game idea just crossed your mind. You and your sister decided to play the game. The game is that, you will write a number N and your sister have to tell in which column the number will reside.

Now, you have to write a program that will help you to determine whether the answer of your sister is correct or not. You need to write a program that will take N as input and the output will be the column number to which the number belongs.

 

The Input

The input file contains several lines of input where each line contains a single positive integer number N. The input will terminated by EOF.

 

Constraints

2<= N <= 10^12

 

The Output

For each lines of input print one line of output which contains the column number.

 

Sample Input

2

9

4

 

Sample Output

2

1

4

 

 

 

Inter University Programming Contest(I) - 2018 [BGC Trust University Bangladesh]

Problem Setter: Puja Chakraborty