Non-consecutive Summands

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given a positive integer nn. You want to write it as a sum of positive integers while obeying both of these rules:

  • No integer may be used more than once (each integer appears at most once).
  • No two consecutive integers may be used together (for example, 33 and 44 cannot both appear).

Subject to these rules, make the number of summands as large as possible. Find that maximum number of summands.

Input

The first and only line contains an integer nn (1n10181 \le n \le 10^{18}).

Output

Print a single integer: the maximum number of summands in such a decomposition.