CSES - HIIT Open 2024 - Equilateral numbers
  • Time limit: 1.00 s
  • Memory limit: 512 MB

The k\text{th} equilateral number is obtained by taking the sum of the first k positive integers. For example, the 5th equilateral number is 1+2+3+4+5=15.

Given a positive integer n, you want to represent it as a sum of equilateral numbers. How many numbers do you need at least?

Input

The only line of the input contains the integer n.

Output

Output the smallest amount of equilateral numbers whose sum is n.

Constraints

  • 1 \le n \le 10^{12}

Example

Input:

5

Output:

3

Explanation: You need at least three equilateral numbers (you can choose 1, 1, and 3).