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>
'''
# BT1
n = int(input())
for i in range(1,n):
	n = n*i
print(n%1000003)


# BT2
n = int(input())
print("*"*n)
for i in range(n-2):
	print("*" + " "*(n-2)+ "*")

print("*"*n)



# BT3
n = int(input())
nghiem = 0
if n < 3:
	nghiem = 0
elif n == 3:
	nghiem = 1
else: 
	for x in range(1,n):
		for y in range(1,n):
			for z in range(1,n):
				if x+y+z == n:
					nghiem += 1

print(nghiem)


# BT4
n = int(input())
listt = []
satisfied = 'YES'
while n != 0:
	
	listt.append(n)

	n = int(input())

for i in range(len(listt)-1):
	if listt[i+1] < listt[i]:
		satisfied = 'NO'
print(satisfied)


# BT5
n = int(input())
listt = []
while n!= -1:
	listt.append(n)
	n = int(input())

print(max(listt), min(listt))


# BT6
n = int(input())
num = 0
while n != 0:
	if n == 5:
		num += 1
	n = int(input())
print(num)


# BT7
n = int(input())
poss = 0
if n == 1:
	print('NO')
elif n == 2:
	print('YES')
else: 
	for i in range(2,n):
		if n%i == 0:
			poss += 1

	if poss == 0:
		print('YES')
	else:
		print('NO')


# BT8
a,b = map(int,input().split())

n = int(input())
num = 0
for i in range(n):
	l,r = map(int,input().split())
	if l <= b <= r and l <= a <= r:
		num += 1
print(num)


# BT9
n = int(input())
result = 'YES'
for i in range(n):
	x = int(input())
	if x%2 != 0:
		result = 'NO'
print(result)


# BT10
x,n = map(int,input().split())
result = 'Fail'
for i in range(n):
	w = int(input())
	if w <= x:
		result = 'True'
print(result)


# BT11
n = int(input())
listt = []
for i in range(n):
	out,inn = map(int,input().split())
	listt.append([out, inn])

#print(listt)
inside = 0
maxNum = listt[0][1] - listt[0][0]
for i in range(len(listt)):
	inside = inside + listt[i][1] - listt[i][0]
	#print(inside)
	#print('maxNum is '+ str(maxNum))
	if inside >= maxNum:
		maxNum = inside
print(maxNum)

'''

# BT12
n = int(input())
cubeLine = 0
sumCube = 0
for i in range(1,n+1):
	cubeLine += i
	sumCube += cubeLine
	#print('sumCube is ' + str(sumCube))
	if sumCube > n:
		print(i-1)
		break
	elif sumCube == n:
		print(i)
		break




