The Cost of the K-dominoes#51

The Cost of the K-dominoes

1 second
64 megabytes
Very easy
Domino Illustration

An employee of the technical control department liked to reject "domino tiles" that had equal values. The factory producing -dominoes was unaware of this, so it regularly received claims with amounts equal to the value of the purchased -domino set. The value of a -domino set is equal to the number of domino tiles in the set bought by the customer.

To avoid being fired, the employee sometimes rejected not only his "favorite" domino tiles, but also a few additional ones, but never more than half the number of guaranteed rejections.

Given the amount of a claim received by the factory, determine which -domino set was bought by the customer.

Input

The only input is a single integer (S \leq 2000000000) — the amount of the claim received by the factory.

Output

Print a single integer — the index of the purchased -domino set.

Examples

Example 1

Loading
Loading