Vanya got n cubes. He decided to build a pyramid from them. Vanya wants to build the pyramid as follows: the top level of the pyramid must consist of 1 cube, the second level must consist of 1 + 2 = 3 cubes, the third level must have 1 + 2 + 3 = 6 cubes, and so on. Thus, the i-th level of the pyramid must have 1 + 2 + ... + (i - 1) + i cubes.

Vanya wants to know what is the maximum height of the pyramid that he can make using the given cubes.

Input

The first line contains integer n (1 ≤ n ≤ 104) — the number of cubes given to Vanya.

Output

Print the maximum possible height of the pyramid in the single line.

Examples

Input

1


Output

1


Input

25


Output

4

Note

Illustration to the second sample: 

<image>
'''
https://codeforces.com/problemset/problem/492/A

Solution:

Say n = 25.

Per layer Boxes   | Total Boxes Used
1                 |      1
1+2 = 3           |      4
1+2+3 = 6         |     10
1+2+3+4 = 10      |     20
1+2+3+4+5 = 15    |     35

Hence at each layer, we add the height (incremented by 1 in each layer) to the previous-layer boxes and that
gives the current layer boxes. Keep adding that to a total accumulation (boxesUsed).

Since we cannot build a layer without having enough boxes for the current-layer, we may over-estimate the height.
Hence, we check if n < boxesUsed after the current layer usage, we reduce the height by 1, thereby descarding the
current layer in the pyramid.

The final height is the answer.

'''

def solve(n):

    height = boxesUsed = prevStepBoxes = 0

    while n > boxesUsed:

        height += 1
        thisStepBoxes = prevStepBoxes + height
        boxesUsed += thisStepBoxes
        prevStepBoxes = thisStepBoxes

        #if this layer is not possible, we over-estimated the height. Reduce it by 1
        if n < boxesUsed:
            height -= 1

    return height


if __name__ == "__main__":
    n = int(raw_input())
    print solve(n)