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 ≤ 10^4) — 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]

Difficulty: interview

Starter code:

Solutions:
n = int(input())
ans = 0
s = 0

while (n > 0):
    ans += 1
    s += ans
    n -= s

    if (n < 0):
        ans -= 1
        break

print(ans)


n=int(input())
ans=0
dec=1
while(n>=dec):
    n-=dec
    ans+=1
    dec+=ans+1
print(ans)


n, i = int(input()), 0
while n * 2 >= i * (i + 1):
    n -= i * (i + 1) // 2
    i += 1
print(i - 1)


__author__ = 'PrimuS'

n = int(input())
i = 0
k = 0
m = 0
while n >= 0:
    i += 1
    m += i
    k += m
    n -= m

print(i - 1)


n, cur, i = int(input()), 0, 0
while cur <= n:
    i += 1
    cur += i * (i + 1) // 2
print(i - 1)

n = int(input())

s = 0
for i in range(10000):
    s += i * (i + 1) // 2
    if s > n:
        print(i - 1)
        return


n=int(input())
H,L=0,1
while L<=n:
  H += 1
  n -= L
  L += H+1
print(H)

import math
s = input()
s = int(s)
n = 0
for i in range(1,10000):
    n+=i
    s-=n
    if s<0:
        ans = i-1
        break
print(ans)


n = int(input())
s = i = level = 0
while 1:
    i += 1
    level += i
    s += level
    if s > n:
        i -= 1
        break
print(i)


n = int(input())
t, s, i = 0, 0, 0
while s <= n :
    i += 1
    t += i
    s += t
    
print(i - 1)


n = int(input())

res = 0
count = 0
for i in range(1, 100000):
    res += sum(j for j in range(1, i+1))
    if res <= n:
        count += 1
    else:
        break

print(count)

s=0
n=int(input())
i=1
while True:
    s+=i
    n-=s
    if n>=0:
        i+=1
    else:
        break
    
print(i-1)
   


n = int(input())
c = 0
for i in range(1, 10000):
    s = 0
    for j in range(1, i + 1):
        s += j
    c += s
    if c > n:
        print(i - 1)
        break
    elif c == n:
        print(i)
        break
        


#Codeforces #492 problem A
n=int(input())
i=1
sum=1

while n>sum:
    i+=1
    sum+=(i*(i+1))/2

if n<sum:
    i-=1

print(i)


cubes= int(input())

remove= 1
height= 0
add= 2
while(cubes > 0):
    cubes-= remove
    remove+= add
    height+=1
    add+= 1

if cubes== 0:
    print(height)
else:
    print(height-1)

'''
Created on ٠١‏/١٢‏/٢٠١٤

@author: mohamed265
'''
n = int(input())
slon = 0
temp = 1
j = 2
while n >= temp:
    slon = slon +1
    n -= temp
    temp += j
    j= j +1
print(slon)


n = int(input())

a = [i for i in range(10000)]
i=0
res=0
while n>0:
    if n<sum(a[:i+1]):
        break
    res+=1
    n-=sum(a[:i+1])
    i+=1
print(res-1)

n = int(input())

used = 0
h = 0
s = 1
while used <= n:
    used += s
    h += 1
    s += h + 1
print(h - 1)


from sys import stdin


def main():
    n = int(stdin.readline().strip())
    step = super = 0
    for h in range(100):
        super += 1
        step += super
        if n < step:
            return h
        n -= step


print(main())


def kubik(n,l):
    l1 = l
    if n<(l*(l+1))//2:
        print(l1-1)
    else:
        kubik(n-((l*(l+1))//2),l+1)
n = int(input())
kubik(n,0)


n = int(input())

ts = 0
s = 0
for i in range(100):
    ts += i
    if s + ts > n:
        print(i - 1)
        break
    s += ts


n = float(input())
s = 0
for x in range(50):
    s += (x**2 + x)/2
    if s>n:
        print(x-1)
        break
    


n=int(input())
i=1;
s=1;
while(s<=n):
    i+=1
    s+=int(((1+i)/2)*i)
print(i-1)


n = int(input())
sum = 0
k = 0
while sum <= n:
    sum += k * (k + 1) // 2
    k += 1

print(k - 2)

__author__ = 'valeriy.shevchuk'

n = int(input())

level = 1
prev = 1
sum = 1


while sum <= n:
    level += 1
    prev += level
    sum += prev

print(level - 1)