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>
from collections import defaultdict

def main(n):
    total = 1
    last_etage = 1
    for etage in range(2,99999):
        if total > n:
            print(etage-2)
            break
        last_etage += etage
        total += last_etage
        #print(etage,last_etage,total)

    return

    tr = {0:2,1:7,2:2,3:3,4:3,5:4,6:2,7:5,8:1,9:2}
    print(tr[int(n[0])] * tr[int(n[1])])
    return
    mx = -99999999999
    a.sort()
    b.sort()
    a2 = 0  # last b 2p
    b2 = 0  # last a 2p
    for d in sorted(list(set([0]+a+b))):
        for a2 in range(a2,n+1):
            if a2==n or a[a2] > d: break
        for b2 in range(b2,m+1):
            if b2==m or b[b2] > d: break
        s1 = a2 * 2 + (n-a2)*3
        s2 = b2 * 2 + (m-b2)*3
        if s1-s2 > mx:
            mx = s1-s2
            res = "{}:{}".format(s1,s2)
    print(res)


def main_input():
    #n = int(input())
    n = int(input())
    #a = [int(i) for i in input().split()]
    #a = map(int, input().split())
    #m = int(input())
    #b = [int(i) for i in input().split()]
    main(n)

if __name__ == "__main__":
    main_input()
