Halfway Point

Given n, find the value printed when the pair-comparison loop reaches its halfway point (the last item index printed there).

Medium4Binary searchMathPrefix sumImplementationNo attempts yetTime limit1sMemory limit512 MB

Problem

A friend of yours wrote a program that compares every pair of nn items exactly once. The program first prints 11 and compares item 11 with items 2,3,4,,n2, 3, 4, \dots, n. It then prints 22 and compares item 22 with items 3,4,5,,n3, 4, 5, \dots, n. It goes on the same way until every pair has been compared exactly once. If it compares item xx with item yy, it never compares item yy with item xx later, and it never compares an item with itself.

Your friend wants to know the moment the program is halfway done. If the total number of comparisons is odd, that is the moment it performs the middle comparison. If the total is even, that is the moment it performs the first of the two middle comparisons.

Find the last number printed when the program is halfway done.

Earlier items take part in more comparisons than later ones, so the answer is not n/2n/2.

Input

The first line contains an integer nn. (2n1092 \le n \le 10^9)

Output

Print on one line the last number your friend's program prints when it is halfway done.