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: EASY
Tags: Implementation

Starter code:

Solutions:
num_of_cubes = int(input())
cubes = 1
last = 1
stage = 0
while num_of_cubes >= cubes:
	num_of_cubes -= cubes
	last += 1
	stage += 1
	cubes += last
print(stage)


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


n = int(input())
levels = 0
count = 0
next_level = 1
while count + next_level <= n:
	count += next_level
	levels += 1
	next_level += levels + 1
print(levels)


n = int(input())
i = 0
while True:
	n -= (i + 1) * (i + 2) // 2
	if n < 0:
		break
	else:
		i += 1
print(i)


n = int(input())
(a, tot, cube) = ([], 0, 0)
for i in range(1, n + 1):
	tot += i
	a.append(tot)
	if sum(a) > n:
		break
if n == 1:
	print('1')
else:
	print(len(a) - 1)


def vc(n):
	height = boxesUsed = prevStepBoxes = 0
	while n > boxesUsed:
		height += 1
		thisStepBoxes = prevStepBoxes + height
		boxesUsed += thisStepBoxes
		prevStepBoxes = thisStepBoxes
		if n < boxesUsed:
			height -= 1
	return height
n = int(input())
print(vc(n))


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


totalblocks = int(input())
level = 0
usedblocks = 0
currentlevelblocks = 0
while totalblocks > 0:
	level += 1
	currentlevelblocks += level
	totalblocks -= currentlevelblocks
	if totalblocks < 0:
		level -= 1
print(level)


k = int(input())
sum = 0
for i in range(1, k + 1):
	sum = sum + i * (i + 1) // 2
	if sum > k:
		print(i - 1)
		break
	elif sum == k:
		print(i)
		break


n = int(input())
e = 0
level = 0
s = 0
while s < n:
	level += 1
	e = e + level
	s += e
if s == n:
	print(level)
else:
	print(level - 1)


a = int(input())
i = 1
r = 1
while r <= a:
	i += 1
	r += i * (i + 1) // 2
print(i - 1)


n = int(input())
level = 0
cub_level = 0
s = 0
while s <= n:
	level += 1
	cub_level += level
	s += cub_level
if s == n:
	print(level)
else:
	print(level - 1)


a = int(input())
s = 0
ts = 0
c = 0
for i in range(1, a + 1):
	s += i
	ts += s
	if ts > a:
		break
	else:
		c = i
print(c)


n = int(input())
i = 1
j = 1
if n > 3:
	n = n - 1
	k = 3
	i = 2
	while n > -1:
		n -= k
		i += 1
		k = i * (i + 1) // 2
		j += 1
	j -= 1
print(j)


n = int(input())
l = 0
k = 1
a = 1
while n > 0:
	k += 1
	a = a + k
	n = n - a
	l += 1
print(l)


n = int(input())
if n == 1:
	print(n)
else:
	s = 0
	k = 0
	i = 1
	while s <= n:
		k += i
		s += k
		i += 1
	if s == n:
		print(i - 1)
	else:
		print(i - 2)


n = int(input())
level = 0
cube = 0
while n >= 0:
	level += 1
	cube += level
	n -= cube
print(level - 1)


a = int(input())
count = 0
while a >= 0:
	count += 1
	a -= count * (count + 1) / 2
print(count - 1)


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


boxes = int(input())
sum = 0

def boxes_on_level(n):
	return 1 if n == 1 else n + boxes_on_level(n - 1)
i = 1
while sum < boxes:
	sum += boxes_on_level(i)
	if sum < boxes:
		i += 1
if sum > boxes:
	i -= 1
print(i)


n = int(input())
for i in range(1, 10000):
	n -= i * (i + 1) / 2
	if n < 0:
		print(i - 1)
		quit()


x = int(input())
h = 0
j = 0
p = 0
for k in range(1, 10000):
	h += k
	p += h
	j += 1
	if p > x:
		print(j - 1)
		exit()


n = int(input())
count = 1
cubes = 1
i = 2
temp = 1
while temp <= n:
	cubes += i
	i += 1
	temp += cubes
	if temp <= n:
		count += 1
print(count)


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


import sys
number = int(sys.stdin.readline().strip())
levels = 1
currentI = 1
blocks = 1
totalBlocks = 1
while number >= totalBlocks:
	levels += 1
	currentI += 1
	blocks += currentI
	totalBlocks += blocks
	if number < totalBlocks:
		levels -= 1
print(levels)


n = int(input())
for i in range(1, 10000):
	s = (i * (i + 1) * (2 * i + 1) // 6 + i * (i + 1) // 2) // 2
	if n == s:
		print(i)
		break
	if n < s:
		print(i - 1)
		break


n = int(input())
c = a = 0
for i in range(1, 1000):
	c = c + i
	n = n - c
	if n >= 0:
		a = a + 1
	else:
		break
print(a)


r = int(input())
i = 1
s = 0
while True:
	s = s + i * (i + 1) / 2
	if s <= r:
		i += 1
	else:
		break
print(i - 1)


def Main():
	n = int(input())
	tot = 0
	for i in range(1, 10000):
		tot += i * (i + 1) // 2
		if tot == n:
			print(i)
			break
		elif tot > n:
			print(i - 1)
			break
Main()


n = int(input())
k = 1
total = 0
full = 0
count = 0
while 1 > 0:
	total = total + k
	full = full + total
	if full <= n:
		count = count + 1
	else:
		break
	k = k + 1
print(count)


n = int(input())
a = 0
b = 0
c = 0
d = 0
while 1 == 1:
	b += 1
	a += b
	d += a
	c += 1
	if d >= n:
		break
if d == n:
	print(c)
else:
	print(c - 1)


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


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


n = int(input())
i = 0
sum1 = 0
count = 0
sum2 = 0
while n > sum2:
	i += 1
	sum1 += i
	sum2 += sum1
	if sum2 <= n:
		count += 1
print(count)


n = int(input())
levels = 0
cubes = 0
while cubes <= n:
	levels += 1
	cubes += levels * (levels + 1) // 2
print(levels - 1)


import math
n = int(input())

def next(s):
	return math.floor(s * (1 + s) / 2)
result = 1
summ = 1
curlvl = 1
while summ <= n:
	result += 1
	curlvl = next(result)
	summ += curlvl
print(1 if result == 1 else result - 1)


n = int(input())
height = 1
total = 1
if n < 3:
	height = 1
else:
	for i in range(2, n):
		m = i * (i + 1) / 2
		total = total + m
		if total <= n:
			height += 1
		else:
			break
print(height)


n = int(input())
(q, z) = (0, 0)
for a in range(1, n + 1):
	z = z + int(a * (a + 1) / 2)
	if z <= n:
		q += 1
	else:
		break
print(q)


n = int(input())
total = 0
i = 1
partial = i
while n - partial >= total:
	total += partial
	i += 1
	partial += i
print(i - 1)


n = int(input())
i = 0
h = 0
c = 0
while n > c:
	i = i + 1
	h = h + i
	c = c + h
	if n < c:
		i = i - 1
print(i)


cubes = int(input())
d = cnt = h = 0
while cubes > 0:
	d += 1
	cnt += d
	if cnt <= cubes:
		cubes -= cnt
		h += 1
	else:
		break
print(h)


n = int(input())
i = 1
j = 1
levels = 0
while n >= i:
	n -= i
	levels += 1
	j += 1
	i += j
print(levels)


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


n = int(input())
lev = 0
vs = 0
ur = 0
while n > ur:
	lev += 1
	vs += lev
	ur = vs + lev
	n = n - vs
print(lev)


cubes = int(input())
if cubes == 1:
	print(1)
else:
	total = 0
	r_cube = 0
	h = 0
	for i in range(1, cubes):
		total += i
		r_cube += total
		if r_cube > cubes:
			break
		h += 1
	print(h)


import itertools

def solve(n):

	def f(x):
		return x * (x + 1) * (x + 2) // 6
	out = itertools.takewhile(lambda i: i <= n, map(f, itertools.count(1)))
	return sum((1 for _ in out))

def test():
	assert solve(1) == 1
	assert solve(25) == 4

def main():
	n = int(input())
	result = solve(n)
	print(result)
main()


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


cubs = int(input())
i = 0
count = 1
while cubs >= i + count:
	i = i + count
	cubs -= i
	count += 1
print(count - 1)


def h(n):
	h = 0
	i = 1
	t = 1
	acc = 1
	while acc <= n:
		i = i + 1
		t = t + i
		h = h + 1
		acc = acc + t
	return h
print(h(int(input())))


a = int(input())
b = 0
c = 0
d = 0
for i in range(1, a + 1):
	b = b + i
	d = d + b
	if d <= a:
		c = c + 1
	else:
		break
print(c)


n = int(input())
b = 1
while sum((a * (a + 1) / 2 for a in range(1, b + 1))) <= n:
	b += 1
print(b - 1)


n = int(input())
height = 0
i = 1
block = int(i * (i + 1) / 2)
while 1:
	if block == n:
		break
	elif block > n:
		i = i - 1
		break
	else:
		i = i + 1
		block = block + int(i * (i + 1) / 2)
print(i)


def count_need(i):
	need = 0
	for i in range(1, i + 1):
		need = need + i
	return need
layer = 0
cubes = int(input())
if cubes == 1:
	layer = 1
else:
	for i in range(1, cubes):
		needs = count_need(i)
		cubes = cubes - needs
		if cubes >= 0:
			layer += 1
		else:
			break
print(layer)


a = int(input())
b = 0
s = 0
while a >= b + (s + 2) * (s + 1) / 2:
	s += 1
	b += s * (s + 1) / 2
print(s)


n = int(input())
h = bu = pb = 0
while n > bu:
	h += 1
	thisStepBoxes = pb + h
	bu += thisStepBoxes
	pb = thisStepBoxes
	if n < bu:
		h -= 1
print(h)


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


n = int(input())
t = [0, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, 1140, 1330, 1540, 1771, 2024, 2300, 2600, 2925, 3276, 3654, 4060, 4495, 4960, 5456, 5984, 6545, 7140, 7770, 8436, 9139, 9880, 10660]
for i in t:
	if i == n:
		print(t.index(i))
		break
	elif i > n:
		print(t.index(i) - 1)
		break


def test(x):
	return x * (x + 1) * (x + 2) // 6
n = int(input())
k = int((6 * n) ** (1 / 3)) - 2
i = k
while test(i) <= n:
	i += 1
i -= 1
print(i)


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


n = int(input())
h = 0
ans = 0
while ans <= n:
	h += 1
	ans += h * (h + 1) // 2
print(h - 1)


n = int(input())
k = 0
delta = 1
last = 0
i = -1
while k <= n:
	last += delta
	k += last
	delta += 1
	i += 1
print(i)


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


n = int(input())
c = 0
i = 0
while n:
	i += 1
	c += i
	n -= c
	if n < c + i + 1:
		break
print(i)


from math import sqrt
n = int(input())
cubes = i = 1
while cubes <= n:
	i += 1
	cubes += i * (i + 1) / 2
print(i - 1)


n = int(input())
m = 0
h = 0
while n > m:
	h += 1
	m += h
	if n < m:
		h -= 1
	n -= m
print(h)


n = int(input())
a = 0
b = 0
c = 0
for i in range(n):
	c = i + 1
	s = int(c * (c + 1) / 2)
	a += s
	if a <= n:
		b = i + 1
	else:
		break
print(b)


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
a = 0
while n > a:
	sum += 1
	for i in range(1, sum + 1):
		a += 1
	n -= a
if n < 0:
	sum -= 1
print(sum)


import sys
n = int(sys.stdin.readline().split()[0])
s = 0
h = 0
while s <= n:
	h += 1
	s += h * (h + 1) // 2
print(h - 1)


n = int(input())
total = 0
t1 = 0
for i in range(1, n + 1, 1):
	t1 += i
	total += t1
	if total > n:
		i -= 1
		break
print(i)


n = int(input())
l = []
l.append(0)
for i in range(1, 10000):
	l.append(l[i - 1] + i)
for i in range(1, 10000):
	l[i] = l[i] + l[i - 1]
for i in range(10000):
	if l[i] > n:
		print(i - 1)
		break


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


n = int(input())
h = 0
cnt = 0
while cnt <= n:
	h += 1
	cnt += h * (h + 1) / 2
print(h - 1)


def Cubes(n):
	i = 1
	sum = 1
	while sum <= n:
		i = i + 1
		sum = sum + i * (i + 1) // 2
	return i - 1
x = int(input())
print(Cubes(x))


n = int(input())
s = 0
tong = 0
i = 1
for i in range(1, n, 1):
	s = s + i
	tong = tong + s
	if n >= tong and n < tong + s + i + 1:
		break
print(int(i))


n = int(input())
a = 1
b = 0
h = 1
while n > a + h + 1:
	h = h + 1
	b = a + h
	if a < b:
		a = b
	n = n - b
print(h)


t = int(input())
n = 1
r = 1
while t >= n:
	t -= n
	r += 1
	n += r
print(r - 1)


n = int(input())
lv_n = 0
hmax = 0
while n > 0:
	hmax += 1
	lv_n += hmax
	n -= lv_n
	if n < 0:
		hmax += -1
print(hmax)


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


n = int(input())
totalCubes = 0
nextLevel = 0
i = 0
while totalCubes <= n:
	i += 1
	nextLevel += i
	totalCubes += nextLevel
print(i - 1)


x = int(input())
t = 0
k = 1
s = 2
while 1:
	x = x - k
	k = k + s
	s = s + 1
	t = t + 1
	if k > x:
		break
print(t)


n = int(input())
c = 0
x = 0
m = 0
while n >= m:
	c = c + 1
	x = x + c
	m = m + x
print(c - 1)


n = int(input())
k = 0
while (k ** 3 + 3 * k * k + 2 * k) / 6 <= n:
	k += 1
print(k - 1)


n = int(input())
k = 1
i = 2
m = 0
while m < n:
	m += k
	k += i
	i += 1
print(i - 2 if m == n else i - 3)


n = int(input())
level = 0
while True:
	tmp = 0
	for i in range(1, level + 1):
		tmp += i
	if tmp <= n:
		n -= tmp
		level += 1
	else:
		break
print(level - 1)


import sys
if False:
	input = open('pyramid.txt', 'r')
else:
	input = sys.stdin
n = int(input.readline())
i = 0
cubes = 0
while n >= cubes + i + 1:
	i = i + 1
	cubes = cubes + i
	n = n - cubes
print(i)


n = int(input())
lim = n
for i in range(1, n + 1):
	k = i
	if k * (k + 1) / 2 > lim:
		print(i - 1)
		break
	elif k * (k + 1) / 2 == lim:
		print(i)
		break
	else:
		lim = lim - k * (k + 1) / 2


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


i = int(input())
n = 1
while sum([x * (n - x) for x in range(1, n)]) <= i:
	n += 1
print(n - 2)


a = int(input())
s = 0
i = 0
q = 0
while s <= a:
	q += 1
	i += q
	s += i
print(q - 1)


n = int(input())
for i in range(1, n + 1):
	num = i * (i + 1) // 2
	n = n - num
	if n < 0:
		print(i - 1)
		break
	elif n == 0:
		print(i)
		break


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


n = int(input())
i = 1
number = 1
suma = 1
while suma <= n:
	number += i + 1
	suma += number
	i += 1
print(i - 1)


n = int(input())
row = 0
used = 0
while True:
	cubes = row * (row + 1) // 2
	used += cubes
	if used > n:
		row -= 1
		break
	elif used == n:
		break
	else:
		row += 1
print(row)


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)


x = int(input())
t = 0
d = 0
for i in range(1, x + 1):
	t = t + i
	d = d + t
	if d > x:
		break
print(i - 1 if i > 1 else 1)


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


l = 1
f = 0
n = int(input())
while True:
	f += eval('+'.join([str(i) for i in range(1, l + 1)]))
	if f >= n:
		print(l - 1 if f > n else l)
		exit(0)
	else:
		l += 1


try:
	x = int(input())
	q = 0
	while True:
		x = x - (q + 2) * (q + 1) // 2
		if x >= 0:
			q = q + 1
		else:
			break
	print(q)
except:
	pass


n = int(input())
i = 1
pyramid = 0
k = 0
while n >= k:
	k = i * (i + 1) // 2
	n = n - k
	if n < 0:
		break
	i += 1
print(i - 1)


n = int(input())
s = 0
for i in range(1, n + 2):
	s = s + i
	n = n - s
	if n < 0:
		print(int(i - 1))
		exit()


a = []
for i in range(1, 1001):
	a.append(i)
pref = []
pref.append(a[0])
for i in range(1, 1000):
	pref.append(pref[i - 1] + a[i])
n = int(input())
for i in range(0, len(pref)):
	n -= pref[i]
	if n < 0:
		print(i)
		break


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


n = int(input())
h = 0
s = 1
while n > 0:
	h += 1
	s = s + h + 1
	n -= s
print(h)


n = int(input())

def row_to_block(row):
	count = 0
	for i in range(1, row + 1):
		count += i
	return count

def find_best_row(n):
	sum = 0
	row = 1
	while True:
		block = row_to_block(row)
		if sum + block > n:
			return row - 1
		row += 1
		sum = sum + block
x = find_best_row(n)
print(x)


n = int(input())
k = 0
sums = {0: 0}
while sums[k] <= n:
	k += 1
	sums[k] = sums[k - 1] + int(k * (k + 1) / 2)
print(k - 1)


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


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


def function():
	n = int(input())
	floor = 0
	while n > 0:
		if n >= (floor + 1) * (floor + 2) // 2:
			n -= (floor + 1) * (floor + 2) // 2
			floor += 1
		else:
			print(floor)
			return
	print(floor)
function()


__author__ = 'Ekaterina'
x = int(input())
for i in range(1, 142):
	x -= (i ** 2 + i) / 2
	if x < 0:
		print(i - 1)
		break
	elif x == 0:
		print(i)
		break
	else:
		continue


n = int(input())
N = 6 * n
lis = []
for m in range(int(N ** (1 / 3)) + 1):
	if m * (m + 1) * (m + 2) <= N:
		lis.append(m)
print(max(lis))


def fun(x):
	return x * (x + 1) * (x + 2) / 6
a = int(input())
n = a ** (1 / 3)
n = round(n + 1)
f = int(n) * int((n + 1) * (n + 2) / 6)
for i in range(1, 40):
	res = a / fun(i)
	if res < 1:
		print(i - 1)
		break


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


n = int(input())
height = 0
prev = 0
sum = 0
while n >= sum:
	height += 1
	prev += height
	sum += prev
print(height - 1)


n = int(input())
s = 0
for i in range(1, 100):
	if s < n:
		s += (i + 1) * i / 2
	elif s == n:
		k = i
		break
	else:
		k = i - 1
		break
print(k - 1)


n = int(input())
i = 1
k = 1
t = 0
a = 1
while a <= n:
	i = i + 1
	k = k + i
	a = a + k
	t = t + 1
print(t)


n = int(input())
n_y = 1
yr = 1
n -= 1
while n > n_y:
	yr = yr + 1
	n_y = n_y + yr
	n = n - n_y
	if n < 0:
		yr -= 1
print(yr)


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


n = int(input())
if 1 <= n <= 10 ** 4:
	i = 0
	b = 0
	j = 0
	a = []
	while j < n:
		i += 1
		a.append(i)
		b = sum(a)
		j += b
		if n == j:
			print(len(a))
	if j > n:
		print(len(a) - 1)


given = int(input())
i = 1
while 1:
	sum = 0
	for t in range(0, i + 1):
		sum += t
	given -= sum
	if given < 0:
		i -= 1
		break
	if given == 0:
		break
	i += 1
print('{}'.format(i))


n = int(input())
i = 1
k2 = 1
while n > k2:
	k1 = k2
	i += 1
	k2 += i * (i + 1) // 2
if n == k2:
	print(i)
else:
	print(i - 1)


n = int(input())
ans = 0
count = 0
for i in range(1, n + 1):
	for j in range(1, i + 1):
		ans += j
	if ans <= n:
		count += 1
	else:
		break
print(count)


from sys import setrecursionlimit
setrecursionlimit(10 ** 6)
numCubes = int(input())
total = 0
height = 1
for i in range(1, numCubes):
	if numCubes == 1:
		break
	total = total + i
	numCubes = numCubes - total
	if numCubes - total > i:
		height += 1
print(height)


def sum(n):
	return n * (n + 1) // 2
t = int(input())
ans = 1
cur = 1
while sum(cur) <= t:
	t -= sum(cur)
	cur += 1
print(cur - 1)


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


__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)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
ans = 1
for h in range(1, N):
	if h * (h + 1) * (h + 2) > N * 6:
		ans = h - 1
		break
print(ans)


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


n = int(input())
floor = 0
cubes = 0
i = 0
while n > floor + cubes + i:
	i = i + 1
	floor = floor + i
	cubes = cubes + floor
print(i)


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


num = int(input())
data = []
total = 0
for i in range(1, num + 1):
	total = total + i
	if sum(data) + total <= num:
		data.append(total)
print(len(data))


def f(n):
	return n * (n + 1) * (n + 2) / 6
n = int(input())
if n <= 20:
	a = 1
	b = 4
else:
	c = n * 6
	r = int(c ** (1 / 3))
	a = r - 2
	b = r + 2
i = b
while f(i) > n:
	i -= 1
print(int(i))


col = int(input())
c = 0
i = 0
b = 0
while b <= col:
	c = c + 1
	i = i + c
	b = b + i
print(c - 1)


n = int(input())
x = 1
ans = 0
while True:
	for i in range(1, x + 1):
		ans = ans + i
	if ans > n:
		print(x - 1)
		break
	elif ans == n:
		print(x)
		break
	else:
		x += 1


def cubes_per_row(row):
	return row * (row + 1) // 2
no_of_cubes = int(input())
(rows, total_cubes) = (1, 1)
while no_of_cubes >= total_cubes:
	rows += 1
	total_cubes += cubes_per_row(rows)
print(rows - 1)


n = int(input())
t = 0
s = 0
while s < n:
	t += 1
	s += t * (t + 1) // 2
if s == n:
	print(t)
else:
	print(t - 1)


N = int(input())
level = 0
d = 0
k = 0
while d < N:
	level += 1
	k += level
	d += k
if d > N:
	level -= 1
print(level)


n = int(input())
l = [i * (i + 1) // 2 for i in range(150)]
h = 0
for e in enumerate(l):
	h += e[1]
	if h > n:
		print(e[0] - 1)
		break


a = int(input())
b = 0
c = 0
e = 1
while c <= a:
	for i in range(e):
		c += i
	b += 1
	e += 1
print(b - 2)


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


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


n = int(input())
num = 1
sum = 1
k = 1
for i in range(1, n):
	if sum <= n:
		num = num + i + 1
		sum = sum + num
		k = i
	else:
		break
print(k)


n = int(input())
ans = 0
x = 1
blocks = 0
while blocks <= n:
	ans = ans + x
	x += 1
	blocks = blocks + ans
print(x - 2)


ans = []
for i in range(1, 100):
	value = i * (i + 1) * (i + 2) // 6
	ans.append(value)
n = int(input())
i = 0
while i < len(ans):
	if ans[i] > n:
		break
	i = i + 1
print(i)


a = int(input())
high = 0
x = 0
i = 0
while x <= a and a != 0:
	high = high + 1
	i = i + high
	x = x + i
print(high - 1)


in_value = int(input())
i = 0
j = 0
result = 0
while j < in_value:
	i = i + (result + 1)
	j = j + i
	if j <= in_value:
		result = result + 1
print(result)


n = int(input())
if n == 1:
	print(1)
else:
	for i in range(1, 10 ** 5):
		n = n - i * (i + 1) / 2
		if n >= 0:
			continue
		else:
			print(i - 1)
			break


n = int(input())
l = []
c = 1
for i in range(1, n + 1):
	a = i * (i + 1) // 2
	l.append(a)
	if sum(l) <= n:
		c = i
	else:
		break
print(c)


heights = {1: 1, 2: 4, 3: 10, 4: 20, 5: 35, 6: 56, 7: 84, 8: 120, 9: 165, 10: 220, 11: 286, 12: 364, 13: 455, 14: 560, 15: 680, 16: 816, 17: 969, 18: 1140, 19: 1330, 20: 1540, 21: 1771, 22: 2024, 23: 2300, 24: 2600, 25: 2925, 26: 3276, 27: 3654, 28: 4060, 29: 4495, 30: 4960, 31: 5456, 32: 5984, 33: 6545, 34: 7140, 35: 7770, 36: 8436, 37: 9139, 38: 9880, 39: 10660}
n = int(input())
i = 1
while heights[i] <= n:
	i += 1
print(i - 1)


n = int(input())
i = 1
cube = 0
amountcube = 0
while True:
	cube = i + cube
	amountcube = amountcube + cube
	if amountcube > n:
		print(i - 1)
		break
	elif amountcube == n:
		print(i)
		break
	i += 1


n = int(input())
(sum, sum_i, i) = (0, 0, 1)
while True:
	sum_i += i
	sum += sum_i
	if sum > n:
		print(i - 1)
		break
	i += 1


n = int(input())
level = 1
kubs = 1
while n - kubs >= 0:
	n -= kubs
	level += 1
	kubs += level
print(level - 1)


n = int(input())
i = 1
res = 1
a = [1]
sum1 = 1
while sum1 <= n:
	i = i + 1
	a.append(i)
	sum1 = sum1 + sum(a)
print(a[-2])


a = int(input())
b = 0
c = 0
while a >= b + c + 1:
	c += 1
	b += c
	a -= b
print(c)


def main():
	n = int(input())
	a = 0
	count = 0
	while a <= n:
		count += 1
		a += sum([i for i in range(1, count + 1)])
	print(count - 1)
main()


n = int(input())
i = 0
sum1 = 0
while 1:
	i += 1
	lis = [k for k in range(1, i + 1)]
	sum1 = sum1 + sum(lis)
	if n < sum1 + sum(lis) + i + 1:
		print(i)
		break


n = int(input())
for i in range(1, n + 1):
	if i * (i + 1) * (i + 2) <= 6 * n < (i + 3) * (i + 1) * (i + 2):
		print(i)
		break


n = int(input())
i = 0
r = 0
while n >= r + i + 1:
	i += 1
	r += i
	n -= r
print(i)


n = int(input())
i = 0
sum = 0
while sum < n:
	for k in range(1, i + 2):
		sum += k
	i += 1
if sum == n:
	print(i)
else:
	print(i - 1)


n = int(input())
a = [0] * 10000
a[0] = 1
aa = [1] * 10000
sum = 1
ans = 0
for i in range(10000):
	a[i] = i + 1 + a[i - 1]
	sum += a[i]
for i in range(1, 10000):
	aa[i] = a[i] + aa[i - 1]
for i in range(10000):
	if n >= aa[i] and n < aa[i + 1]:
		ans = i
print(ans + 1)


(n, f, ans) = (int(input()), 0, 0)
for i in range(n):
	f += i + 1
	n -= f
	if n >= 0:
		ans += 1
	else:
		break
print(ans)


n = int(input())
i = 1
h = 0
k = 1
l = 1
while i <= n:
	l += 1
	k += l
	i += k
	h += 1
print(h)


def main():
	num = int(input())
	pyramid = []
	pyramid.append(1)
	levelBlocks = 1
	totalBlocks = 1
	levels = 1
	curr = 2
	while True:
		if num <= totalBlocks:
			break
		levelBlocks += curr
		totalBlocks += levelBlocks
		curr += 1
		levels += 1
		if num < totalBlocks:
			levels -= 1
			break
	print(levels)
main()


n = int(input())
i = 1
while True:
	a = (i + 1) * (i + 2) * i
	b = (i + 1) * (i + 3) * (i + 2)
	if b > 6 * n >= a:
		print(i)
		break
	else:
		i += 1


i = 0
last = 0
current = 0
a = int(input())
while a > 0:
	i += 1
	current = last + i
	last = current
	a -= current
	if a < 0:
		i -= 1
print(i)


number = int(input())
sum = 0
row = 0
while sum <= number:
	sum = 0
	row += 1
	for i in range(1, row + 1):
		sum += (row + 1 - i) * i
print(row - 1)


n = int(input())
inc = 0
sum = list()
last = 0
tots = 0
i = 1
sum.append(0)
while n > tots:
	inc = inc + 1
	sum.append(sum[i - 1] + inc)
	for j in range(0, len(sum)):
		tots = tots + sum[j]
	if tots > n:
		inc = inc - 1
		break
print(inc)


def solve(n):
	i = 1
	s = 1
	total = 0
	while total < n:
		i += 1
		s += i
		total += s
	print(i - 1)

def main():
	solve(int(input()))
main()


n = int(input())
count = 0
sum = 0
tmp = 0
for i in range(1, n + 1):
	sum += i
	tmp += sum
	if tmp > n:
		break
	count += 1
print(count)


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 = int(input().strip())
i = 1
s = 1
while s <= n:
	i += 1
	s += (1 + i) * i // 2
if i == 1:
	print('1')
else:
	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())
x = 1
s = 0
c = 0
while True:
	for i in range(x + 1):
		s += i
	x += 1
	if s > n:
		break
	c += 1
print(c)


n = int(input())
t = 1
h = 1
s = 1
while s + t + h + 1 <= n:
	h += 1
	t += h
	s += t
print(h)


def n_sum(n):
	return n * (n + 1) // 2
cubes = int(input())
floor = 0
while True:
	req = n_sum(floor + 1)
	if cubes >= req:
		cubes -= req
		floor += 1
	else:
		break
print(floor)


n = int(input())
sum = 0
count = 0
temp = 1
while count <= n:
	sum += temp
	temp += 1
	count += sum
if n == 1:
	print(1)
else:
	print(temp - 2)


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


sum_of_cube = int(input().strip())
(sum_in, cnt) = (0, 0)
while sum_in <= sum_of_cube:
	cnt += 1
	sum_in += (1 + cnt) * cnt / 2
print(cnt - 1)


import bisect
N = int(input())
l = [0]
for i in range(1, 1000):
	l.append(l[-1] + i * (i + 1) // 2)
ind = bisect.bisect_left(l, N)
if l[ind] > N:
	print(ind - 1)
else:
	print(ind)


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


squareNumber = int(input())
totalsum = 0
i = 0
while True:
	if squareNumber >= 1 and squareNumber <= 10 ** 4:
		break
	else:
		print('Write the right number')
		squareNumber = int(input('Write the number of the squares'))
while squareNumber > totalsum:
	totalsum = 0
	for sqare in range(1, i + 2):
		totalsum += sqare
	squareNumber -= totalsum
	if squareNumber >= 0:
		i += 1
print(i)


n = int(input())
level = 1
part_s = 1
s = 1
while s <= n:
	level += 1
	part_s += level
	s += part_s
print(level - 1)


n = int(input())
sum = 0
x = 0
for i in range(1, n + 1):
	sum += i * (i + 1) / 2
	x += 1
	if sum == n:
		print(x)
		break
	elif sum > n:
		print(x - 1)
		break
	else:
		continue


n = int(input())
series = 0
xn = 1
while True:
	series += xn * (xn + 1) / 2
	if series > n:
		break
	xn += 1
print(xn - 1)


a = int(input())
heg = 0
x = 0
count = 0
while a >= x + heg + 1:
	heg += 1
	x = x + heg
	a -= x
	count += 1
print(count)


n = int(input())
x = 0
i = 1
while n >= x:
	x += sum(range(i)) + i
	i += 1
print(i - 2)


n = int(input())
level = 0
i = 0
while n > 0:
	i += 1
	tot = i * (i + 1) // 2
	if n - tot >= 0:
		n = n - tot
		level += 1
	else:
		break
print(level)


(n, l, c, a) = (int(input()), 0, 0, 1)
while n >= 0:
	c += a
	a += 1
	n -= c
	l += 1
print(l - 1)


N = int(input())
X = [x for x in range(1, 10 ** 5)]

def Csum2(array):
	for i in range(1, len(array)):
		array[i] = array[i] + array[i - 1]
	return array
S = Csum2(X)
S2 = Csum2(S)
import bisect
print(bisect.bisect_right(S2, N))


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


n = int(input())
totalCubes = 0
totalLine = 0
totalCubesInLine = 0
if n != 1:
	for i in range(1, n):
		totalCubesInLine = totalCubesInLine + i
		totalCubes = totalCubes + totalCubesInLine
		if totalCubes > n:
			break
		else:
			totalLine = i
else:
	totalLine = 1
print(totalLine)


n = int(input())
k = 1
s = 0
while n:
	s += k
	n -= s
	if n - (s + k) <= 0:
		break
	k += 1
print(k)


from math import cosh, acosh
N = float(input())
sq3 = 3 ** 0.5
L = 2.0 / sq3 * cosh(acosh(9 * sq3 * N) / 3.0) - 1
print(int(L + 1e-06))


n = int(input())
cubes = 0
start = 1
flag = True
while flag:
	cubes += start * (start + 1) // 2
	if cubes > n:
		start -= 1
		flag = False
		break
	start += 1
print(start)


n = int(input())
height = 0
width = 1
while n - width >= 0:
	height += 1
	n -= width
	width += height + 1
print(height)


n = int(input())
Sum = 0
Count = 0
i = 1
while True:
	Sum += i
	n -= Sum
	Count += 1
	if n < Sum + (i + 1):
		break
	i += 1
print(Count)


def func(n):
	return n * n * n + 3 * n * n + 2 * n
x = 6 * int(input())
level = 1
while func(level) <= x:
	level += 1
print(level - 1)


l = int(input())
cnt = 1
t = 1
n = 2
s = n * (n + 1) // 2
while t + s <= l:
	t = t + s
	cnt = cnt + 1
	n = n + 1
	s = n * (n + 1) // 2
print(cnt)


n = int(input())
ans = 0
while True:
	ans += 1
	if ans * (ans + 1) * (ans + 2) // 6 > n:
		break
print(ans - 1)


n = int(input())
tc = 0
i = 1
while True:
	cinalevel = i * (i + 1) // 2
	tc += cinalevel
	if tc == n:
		print(i)
		break
	if tc > n:
		print(i - 1)
		break
	i += 1


n = int(input())
n1 = n
k = 0

def cube(x):
	s = 0
	for i in range(1, x + 1):
		s = s + i
	return s
for i in range(1, n1):
	z = cube(i)
	n = n - z
	if n < 0:
		k = i
		break
print(1) if 1 <= n1 <= 2 else print(0) if n1 <= 0 else print(k - 1)


x = int(input())
p = 1
c = 0
s = 0
i = 2
while x >= 1:
	c += 1
	p = p + i
	i = i + 1
	x = x - p
print(c)


n = int(input())
c = 0
w = 0
for i in range(1, 200, 1):
	c += i
	w += c
	if n < w:
		print(i - 1)
		exit()


n = int(input())
w = 1
ans = 0
while 1:
	n -= w * (w + 1) / 2
	if n < 0:
		break
	w += 1
	ans += 1
print(ans)


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


n = int(input())
sum1 = 0
a = []
for i in range(1, 10000):
	sum1 = sum1 + i
	a.append(sum1)
	if sum(a) > n:
		print(len(a) - 1)
		break


import math
c = int(input())
n = 0
i = 0
while n < c:
	n = n + (i * i + i) / 2
	if n <= c:
		i += 1
print(i - 1)


n = int(input())
i = 1
sum = 0
x = n - sum
cnt = 0
while x > 0:
	sum += i
	cnt += 1
	i += 1
	n -= sum
	x = n - sum
if n < 0:
	print(cnt - 1)
else:
	print(cnt)


n = int(input())
dem = 0
sum = 0
while True:
	if sum > n:
		break
	else:
		dem += 1
		sum += dem * (dem + 1) / 2
print(dem - 1)


n = int(input())
h = 0
s = 1
sm = 0
while sm <= n:
	if sm + s > n:
		break
	h += 1
	s += h
	sm += s
print(h)


def sums(n):
	return n * (n + 1) // 2
n = int(input())
i = 1
counter = 0
while n - sums(i) >= 0:
	counter += 1
	n -= sums(i)
	i += 1
print(counter)


(n, cnt_cubes, cnt_height) = (int(input()), 0, 0)
while cnt_cubes < n:
	cnt_height += 1
	cnt_cubes += (1 + cnt_height) / 2 * cnt_height
	if cnt_cubes > n:
		cnt_height -= 1
print(cnt_height)


__author__ = 'myduomilia'
n = int(input())
a = [0 for i in range(n + 1)]
for i in range(1, n + 1):
	a[i] = a[i - 1] + i
s = 0
for i in range(len(a)):
	s += a[i]
	if s == n:
		print(i)
		break
	if s > n:
		print(i - 1)
		break


m = [0, 1]
sm = 1
for i in range(2, 500):
	sm += i
	m.append(m[i - 1] + sm)
n = int(input())
for (i, x) in enumerate(m):
	if n < x:
		break
	ans = i
print(ans)


n = int(input())
c = 1
i = 2
d = 1
while i <= n // 2:
	c += i * (i + 1) // 2
	if c <= n:
		d += 1
	else:
		break
	i += 1
print(d)


i = int(input())
total = 0
cubes = 0
row = 1
totalCubes = 0
while i >= 0:
	cubes += row
	row += 1
	i -= cubes
	if i >= 0:
		total += 1
print(total)


n = int(input())
t = 0
i = 1
l = 0
c = 0
while c <= n:
	t = t + i
	i = i + 1
	c = t + c
	if c > n:
		break
	l += 1
print(l)


n = int(input())
x = 0
for i in range(1, n + 2):
	x += i * (i + 1) / 2
	if x > n:
		print(i - 1)
		break


import sys
import math
import bisect

def main():
	n = 100
	A = [0] * n
	for i in range(n):
		A[i] = i + 1
		if i:
			A[i] += A[i - 1]
	for i in range(1, n):
		A[i] += A[i - 1]
	n = int(input())
	first = 0
	last = bisect.bisect_right(A, n)
	print(last - first)
main()


n = int(input())
s = n * 2
i = 1
sm = 0
c = -1
while sm <= s:
	sm = sm + i * (i + 1)
	c = c + 1
	i = i + 1
print(c)


n = int(input())
a = b = 1
while n > 0:
	b += 1
	a += b
	n -= a
print(b - 1)


n = int(input())
num = 0
i1 = 0
for i in range(1, 10 ** 4):
	i1 += i
	n -= i1
	if n < 0:
		break
	num += 1
print(num)


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


n = int(input())
posl_kub = 0
sum_ryad = 0
sum_total = 0
h = 0
while sum_total + sum_ryad + posl_kub + 1 <= n:
	posl_kub += 1
	sum_ryad += posl_kub
	sum_total += sum_ryad
	h += 1
print(h)


currSum = 0
n = int(input())
currLevel = 0
if n == 1:
	print(1)
else:
	while currSum <= n:
		currSum += currLevel * (currLevel + 1) // 2
		if currSum > n:
			print(currLevel - 1)
		else:
			currLevel += 1


kub = int(input())
level = 0
count = 1
while kub >= count:
	level = level + 1
	count = level + count
	kub = kub - count
print(level)


n = int(input())
total = 0
i = 0
if n == 0:
	print(0)
	exit(0)
while total <= n:
	i += 1
	total += i * (i + 1) // 2
print(i - 1)


n = int(input())
count = 1
rng = 2
i = 1
while True:
	count += sum(range(rng + 1))
	rng += 1
	if count <= n:
		i += 1
	else:
		print(i)
		break


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


n = int(input())
pyramid = []
while n >= 0:
	pyramid.append(sum(range(len(pyramid) + 1)))
	n -= pyramid[-1]
print(len(pyramid) - 2)


x = int(input())
z = True
a = 0
b = 0
while z:
	a = a + 1
	b = b + a
	if x >= b:
		x = x - b
	else:
		print(a - 1)
		exit()


n = int(input())
c = 0
i = 0
l = 0
while c < n:
	l = i * (i + 1) // 2
	c = c + l
	if c <= n:
		i = i + 1
print(i - 1)


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


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


n = int(input())
level = 0
cur = 1
while n >= cur:
	level += 1
	n -= cur
	cur += level + 1
print(level)


def solve(cubes):
	count = 0
	height = 1
	while count < cubes:
		height += 1
		count += height * (height + 1) / 2
	return height - 1
n = int(input())
print(solve(n))


n = int(input())
s = 1
l = 0
while n >= s:
	n -= s
	l += 1
	s += l + 1
print(l)


x = int(input())
a = 0
b = 0
for i in range(1, 10000):
	a += i
	b += a
	if b > x:
		print(i - 1)
		quit()


number_of_cubes = int(input())
height = 0
sum_of_cubes = 0
sum_of_heights = 0
while sum_of_cubes < number_of_cubes:
	height += 1
	sum_of_heights += height
	sum_of_cubes += sum_of_heights
if sum_of_cubes == number_of_cubes:
	print(height)
else:
	print(height - 1)


from math import factorial as fct

def ps(n, m):
	return int(fct(n) / (fct(m) * fct(n - m)))

def cl(n):
	return ps(n + 2, 3)

def cdt(n):
	dt = dict()
	for x in range(n):
		x += 1
		dt[cl(x)] = x
	return dt

def dl(dt, n):
	v = list(dt.keys())
	for x in range(len(v)):
		if v[x + 1] > n:
			return v[x]
dt = cdt(39)
l = dl(dt, int(input()))
print(dt[l])


n = int(input())
k = 0
m = 1
s = 1
while n > 0:
	k += 1
	n -= s
	m += 1
	s += m
if n < 0:
	k -= 1
print(k)


__author__ = 'Utena'
n = int(input())
i = 1
while True:
	if i * (i + 1) * (i + 2) // 6 > n:
		print(i - 1)
		exit(0)
	i += 1


n = int(input())
l = [0] * 10001
l[1] = 1
for i in range(2, 10001):
	l[i] = i + l[i - 1]
for i in range(2, 10001):
	l[i] = l[i] + l[i - 1]
for i in range(1, n + 1):
	if l[i] <= n and l[i + 1] > n:
		print(i)
		break


n = int(input())
a = 0
ip = 0
ipc = 0
if 0 < n < 4:
	print(1)
else:
	while n > ipc:
		a += 1
		ip += a
		ipc += ip
	if n < ipc:
		print(a - 1)
	else:
		print(a)


n = int(input())
count = 0
total = 0
l = 0
if n == 1:
	print(1)
else:
	while total <= n:
		count += 1
		l = l + count
		total = total + l
	print(count - 1)


a = int(input())
alpha = 0
count = 0
while a >= 0:
	count = count + 1
	alpha = alpha + count
	a = a - alpha
print(count - 1)


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


n = int(input())
a = 1
b = 2
while n >= 0:
	n -= a
	a += b
	b += 1
print(b - 3)


n = int(input())
k = n
h = 0
p = 1
while k > 0:
	k -= int(p * (p + 1) / 2)
	p += 1
	h += 1
if k < 0:
	print(h - 1)
else:
	print(h)


(n, k, i) = (int(input()), 1, 1)
while n >= k:
	n -= k
	i += 1
	k += i
print(i - 1)


num = int(input())
sum_1 = 0
i = 1
while sum_1 < num:
	sum_1 += int(i * (i + 1) / 2)
	if sum_1 > num:
		print(i - 1)
		break
	elif sum_1 == num:
		print(i)
		break
	i += 1


s = int(input())
c = 0
cube = 1
while s > 0 and s >= cube * (cube + 1) // 2:
	s -= cube * (cube + 1) // 2
	cube += 1
	c += 1
print(c)


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


n = int(input())
counter = 1
subtractor = 1
while n > 0:
	counter += 1
	subtractor += counter
	n -= subtractor
print(counter - 1)


n = int(input())
count = 0
value = 0
h = 0
while value <= n:
	h = h + 1
	count = count + h
	value = value + count
print(h - 1)


n = int(input())
height = 0
total = 0
while True:
	if n - total >= 0:
		height += 1
		for i in range(height):
			total += i + 1
	else:
		break
print(height - 1)


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


def nsum(n):
	if n == 1:
		summ = 1
	elif n == 2:
		summ = 3
	else:
		summ = n * (n + 1) // 2
	return summ
n = int(input())
stories = 0
cubes = 0
i = 0
while cubes < n:
	i += 1
	cubes += nsum(i)
if cubes > n:
	print(i - 1)
else:
	print(i)


isDebug = False
n = int(input())
h = 0
u = 0
while n > 0:
	print(f'-------------------') if isDebug else ''
	h = h + 1
	u = u + h
	print(f'h={h}, u={u}') if isDebug else ''
	if n >= u:
		n = n - u
	else:
		n = 0
		h = h - 1
print(f'{h}')


a = int(input())
i = 0
count = 0
while a > i + count:
	count += 1
	i = i + count
	a -= i
print(count)


def s(h):
	return int(h * (h + 1) * (h + 2) / 6)
n = int(input())
h = 1
while s(h) <= n:
	h += 1
print(h - 1)


n = int(input())
x = 1
while x * (x + 1) * (x + 2) <= 6 * n:
	x += 1
print(x - 1)


n = int(input())
f = 0
k = 1
coN = 0
t = 0
while coN < n:
	f += k
	k += 1
	coN += f
	if coN > n:
		break
	t += 1
print(t)


x = y = r = 1
n = int(input())
while x + y + r + 1 <= n:
	r += 1
	y += r
	x += y
print(r)


n = int(input())
if n == 1:
	print('1')
else:
	sum_ = 0
	count = 0
	add_ = -1
	for i in range(1000):
		sum_ = sum_ + i
		count = count + sum_
		if count <= n:
			add_ = add_ + 1
		else:
			break
	print(add_)


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


n = int(input())
(l, r) = (-1, 10 ** 100)
while r > l + 1:
	m = (l + r) // 2
	if m * (m + 1) * (m + 2) <= 6 * n:
		l = m
	else:
		r = m
print(l)


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


cubes = int(input())
if cubes == 1 or cubes == 2 or cubes == 3:
	lvl = 1
else:
	lvl = 2
ammount = 3
cubes = cubes - 4
while cubes > ammount + lvl:
	lvl += 1
	ammount = ammount + lvl
	cubes = cubes - ammount
print(lvl)


n = int(input())
t = c = 1
while n > 0:
	c += 1
	t += c
	n -= t
print(c - 1)


n = int(input())
i = 0
k = 0
summa = 0
while summa <= n:
	i += 1
	k += i
	summa += k
print(i - 1)


n = int(input())
a = 1
b = 1
count = 0
while True:
	if n < a:
		break
	n -= a
	count += 1
	a += b + 1
	b += 1
print(count)


n = int(input())
height = 1
total = 1
total1 = 1
cube = 1
while total1 < n:
	cube += 1
	total += cube
	total1 += total
	if total1 <= n:
		height += 1
print(height)


a = int(input())
niz = 1
level = 1
sum = 1
while a > sum:
	ost = a - sum
	niz = niz + (level + 1)
	if niz <= ost:
		level += 1
	sum = sum + niz
print(level)


n = int(input())
cub_level = 0
level = 0
summa = 0
while summa < n:
	level += 1
	cub_level += level
	summa += cub_level
if summa == n:
	print(level)
else:
	print(level - 1)


n = int(input())
dp = [0] * 10 ** 4
(dp[0], dp[1]) = (1, 4)
if n < 4:
	print(1)
elif n >= 4 and n < 10:
	print(2)
else:
	for x in range(2, 10 ** 4):
		dp[x] = sum(range(x + 2)) + dp[x - 1]
		if not n >= dp[x]:
			print(x)
			break


n = int(input())
answ = 0
i = 1
z = 2
while n != 0:
	if n - i < 0:
		break
	else:
		n -= i
		i += z
		z += 1
		answ += 1
print(answ)


n = int(input())
x = 1
xl = [1]
y = 2
c = 1
while n > sum(xl):
	x += y
	xl.append(x)
	y += 1
	c += 1
	if sum(xl) > n:
		c -= 1
print(c)


n = int(input())
ni = 0
nn = 0
i = 0
while n > nn:
	i += 1
	ni += i
	nn += ni
if nn > n:
	i -= 1
print(i)


n = int(input())
level = 0
coub_level = 0
s = 0
while s < n:
	level += 1
	coub_level += level
	s += coub_level
if s == n:
	print(level)
else:
	print(level - 1)


def single_integer():
	return int(input())

def multi_integer():
	return map(int, input().split())

def string():
	return input()

def multi_string():
	return input().split()
n = single_integer()
i = 1
ans = 0
while True:
	ans += i * (i + 1) // 2
	if ans == n:
		print(i)
		break
	elif ans > n:
		print(i - 1)
		break
	i += 1


n = int(input())
m = 0
count = 1
total = 0
while total < n:
	m += count
	total += m
	count += 1
print(count - 2 if total > n else count - 1)


n = int(input())
cou = 0
i = 1
prev = 0
li = []
while prev < n:
	prev += i
	i += 1
	cou += 1
	li.append(prev)
	if sum(li) >= n:
		break
if sum(li) > n:
	print(cou - 1)
else:
	print(cou)


n = int(input())
var = 0
for i in range(1, 100000):
	var += i * (i + 1) // 2
	if var > n:
		print(i - 1)
		exit()


B = int(input())

def blockslessthank(n, k):
	total_blocks = n * (n + 1) * (2 * n + 4) // 12
	return total_blocks <= k
lo = 1
hi = 50
while lo < hi:
	mid = (lo + hi + 1) // 2
	if blockslessthank(mid, B):
		lo = mid
	else:
		hi = mid - 1
print(lo)


def solve():
	n = int(input())
	s = 0
	k = 0
	while s < n:
		k += 1
		s += k * (k + 1) // 2
	if s > n:
		print(k - 1)
	else:
		print(k)
solve()


import math
from collections import Counter

def get(f):
	return map(f, input().split())

def divides(a, b):
	return a % b == 0

def main():
	n = int(input())

	def s(a0, d, m):
		return (2 * a0 + (m - 1) * d) * m / 2
	i = 1
	cur = 0
	while True:
		cur += s(1, 1, i)
		if cur > n:
			print(i - 1)
			return
		i += 1
main()


n = int(input())
i = 0
x = 0
while n >= x + i + 1:
	i = i + 1
	x = x + i
	n = n - x
print(i)


n = int(input())
h = 1
i = 1
s = 1
while s < n:
	i += h + 1
	s += i
	if s <= n:
		h += 1
	else:
		break
print(h)


n = int(input())
s = 0
c = 0
while n > 0:
	c += 1
	s += c
	n -= s
if n < 0:
	print(c - 1)
else:
	print(c)


last_num = 0
last_sum = 0
num_cubes = int(input())
while num_cubes >= 0:
	last_num += 1
	last_sum += last_num
	num_cubes -= last_sum
print(last_num - 1)


n = int(input())
h = 1
num_cube = 0
while 1:
	num_cube += h * (h + 1) / 2
	if num_cube > n:
		break
	h += 1
print(h - 1)


n = int(input())
s = t = p = c = 1
while s <= n:
	c += 1
	p = t
	t += c
	s += t
print(c - 1)


a = int(input())
total = 0
x = 0
ans = 0
while True:
	x += 1
	t = 0
	for i in range(1, x + 1):
		t += i
	total += t
	if total > a:
		break
	else:
		ans += 1
print(ans)


x = int(input())
z = 1
s = 1
y = 0
while y < x:
	z = int(s * (s + 1) / 2)
	y += z
	s += 1
if y > x:
	s -= 1
print(s - 1)


n = int(input())
k = 1
while True:
	if sum((i * (i + 1) / 2 for i in range(1, k))) > n:
		print(k - 2)
		break
	k = k + 1


n = int(input())
ans = 0
for i in range(n):
	for j in range(1, i + 1):
		ans += j
		if ans > n:
			break
	if ans > n:
		break
if n == 1 or n == 2 or n == 3:
	print('1')
else:
	print(i - 1)


a = int(input())
c = 0
i = 0
n = 0
while c <= a:
	i += 1
	k = c
	c += i + n
	n = c - k
print(i - 1)


n = int(input())
a = 0
while a * (a + 1) * (a + 2) <= 6 * n:
	a += 1
a -= 1
print(a)


n = int(input())
(cnt, r) = (0, 0)
for i in range(1, n + 1):
	cnt = cnt + i * (i + 1) // 2
	if cnt <= n:
		r = i
print(r)


n = int(input())
s = 0
i = 1
sum = 0
if n == 1:
	print(1)
else:
	while not n < sum:
		s += i
		sum += s
		i += 1
	print(i - 2)


n = int(input())
count = 0
need = 1
i = 2
while True:
	n = n - need
	need = need + i
	count = count + 1
	i = i + 1
	if need > n:
		break
print(count)


n = int(input())
a = 2
c = 0
if n > 1:
	d = 1
	l = [1]
	for i in range(1, n + 1):
		if n >= sum(l):
			d += a
			a += 1
			c += 1
			l.append(d)
	print(c)
elif n == 1:
	print(1)
else:
	print(0)


n = int(input())
r = 1
t = 1
v = 0
while n > 0:
	n = n - t
	if n >= 0:
		v += 1
	r += 1
	t = t + r
print(v)


n = int(input())
i = 1
count = 0
(sum1, sum2) = (0, 0)
l = []
while 1:
	sum1 = sum1 + i
	sum2 = sum2 + sum1
	l.append(sum1)
	count += 1
	i += 1
	if sum2 >= n:
		break
if sum(l) > n:
	print(len(l) - 1)
else:
	print(len(l))


inp = int(input())
cubes_used = 0
floors = 0
total_cubes = inp
for num in range(1, inp + 1):
	cubes_used += num
	total_cubes -= cubes_used
	if total_cubes >= 0:
		floors += 1
	else:
		break
print(floors)


n = int(input())
c1 = 0
c = 0
for i in range(1, n + 1):
	if c + int(i * (i + 1) / 2) <= n:
		t = i * (i + 1)
		c = c + int(t / 2)
		c1 += 1
	else:
		break
print(c1)


n = int(input())
h = 0
need = 1
while n >= need:
	h += 1
	need += h
	n -= need
print(h)


n = int(input())
k = 0
r = 0
s = 0
for i in range(1, n + 1):
	r += i
	s += r
	if s <= n:
		k += 1
	else:
		break
print(k)


n = int(input())
cubes = 0
for i in range(1, 10 ** 4):
	cubes += i * (i + 1) * 0.5
	if cubes > n:
		break
print(i - 1)


def solve(n):
	s = [0 for _ in range(10 ** 4)]
	for i in range(10 ** 4):
		s[i] += (1 + i) * i // 2
	x = 0
	for i in range(1, 10 ** 4):
		if x + s[i] > n:
			return i - 1
		else:
			x += s[i]

def main():
	n = int(input())
	print(solve(n))
main()


n = int(input())
a = []
i = 1
s = 0
c = 0
while sum(a) <= n:
	s = s + i
	a.append(s)
	i = i + 1
	c = c + 1
print(c - 1)


n = int(input())
(level, summ) = (0, 0)
while n >= 0:
	level += 1
	summ += level
	n -= summ
print(level - 1)


n = int(input())
sumL = 1
cubL = 1
total = 1
while total <= n:
	cubL = cubL + 1
	sumL = sumL + cubL
	total = total + sumL
print(cubL - 1)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
(amount, count, curr, i) = (int(f_input()), 0, 0, 1)
while amount > 0:
	curr += i
	if amount - curr < 0:
		break
	amount -= curr
	count += 1
	i += 1
f_print(str(count))


a = int(input())
k = 0
while k * (k + 1) * (k + 2) <= 6 * a:
	k = k + 1
print(k - 1)


def sum_cubes(i):
	if i == 1:
		return 1
	else:
		return i + sum_cubes(i - 1)
n = int(input())
i = 1
while True:
	cubes = sum_cubes(i)
	if n >= cubes:
		n -= cubes
		i += 1
	else:
		break
print(i - 1)


def f(x):
	return x * (x + 1) * (x + 2) / 6
n = int(input())
x = 1
while n >= f(x):
	x += 1
print(x - 1)


n = int(input())
i = 1
res = 0
j = 1
while j <= n:
	n -= j
	i += 1
	j = j + i
print(i - 1)


n = int(input())
i = 1
res = 1
while n >= i:
	n -= i
	res += 1
	i = int(res * (res + 1) / 2)
	if n < i:
		break
print(res - 1)


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


n = int(input())
count = 0
row = 1
while n - row >= 0:
	count += 1
	n -= row
	row += count + 1
print(count)


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


n = int(input())
t = 1
c = 1
i = 1
while t <= n:
	i += 1
	c += i
	t += c
print(i - 1)


a = int(input())
last = 0
c = 0
i = 0
while a > 0:
	i += 1
	c = last + i
	last = c
	a -= c
	if a < 0:
		i -= 1
print(i)


n = int(input())
i = 0
b = 0
while n >= i + (1 + b):
	i += 1 + b
	n -= i
	b += 1
print(b)


from math import *
from collections import deque
from copy import deepcopy
import sys

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def multi():
	return map(int, input().split())

def strmulti():
	return map(str, inp().split())

def lis():
	return list(map(int, inp().split()))

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def stringlis():
	return list(map(str, inp().split()))

def out(var):
	sys.stdout.write(str(var))

def printlist(a):
	print(' '.join((str(a[i]) for i in range(len(a)))))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
i = 1
num = 0
if n == 1:
	print(1)
	exit(0)
while num < n:
	num += i * (i + 1) // 2
	if num + (i + 1) * (i + 2) // 2 > n:
		break
	i += 1
print(i)


a = int(input())
b = c = d = e = 0
while a >= e:
	c += 1
	b += c
	e += b
	d += 1
print(d - 1)


n = int(input())
i = 0
k = 0
summ = 0
while summ <= n:
	i += 1
	k += i
	summ += k
print(i - 1)


def num_cubes(i):
	return 1 / 6 * i * (i + 1) * (i + 2)
n = int(input())
i = 0
while num_cubes(i) <= n:
	i += 1
print(i - 1)


n = int(input())
i = 1
sum = 1
while n > sum:
	i += 1
	sum += i * (i + 1) / 2
if n < sum:
	i -= 1
print(i)


n = int(input())
k = 0
l = 0
i = 1
while n >= l:
	l = l + i
	if n < l:
		break
	n = n - l
	k = k + 1
	i = i + 1
print(k)


n = int(input())
count = 0
layer = 0
step = 0
while count < n:
	layer += 1
	step += layer
	count += step
	if n <= count:
		break
if n < count:
	print(str(layer - 1))
else:
	print(str(layer))


import sys

def main():
	n = int(input()) + 1
	a = [0] * n
	_sum = 0
	for i in range(1, n):
		a[i] = a[i - 1] + i
		_sum += a[i]
		if _sum > n - 1:
			print(i - 1)
			return
		if _sum == n - 1:
			print(i)
			return
sys.exit(main())


n = int(input())
i = 1
levels = 0
sum = 0
while n >= sum:
	sum = sum + i
	if n >= sum:
		i = i + 1
		levels = levels + 1
	n = n - sum
print(levels)


n = int(input())
h = row = sm = 0
while sm < n:
	h += 1
	row += h
	sm += row
	if sm + row + h >= n:
		break
print(h)


x = int(input())
y = 1
z = y + 1
k = y + z
c = y + k
i = 0
while c <= x:
	y = c
	z = z + 1
	k = k + z
	c = y + k
	i += 1
print(i + 1)


t = int(input())
i = 0
if t == 1:
	print(1)
	exit()
while True:
	n = i * (i + 1) * (2 * i + 4) // 12
	if n >= t:
		if n == t:
			print(i)
			exit()
		break
	i += 1
print(i - 1)


n = int(input())
a = 0
ans = 0
for x in range(1, n + 1):
	a += x
	if n >= a:
		ans += 1
	n -= a
print(ans)


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


n = int(input())
indez = 1
res = 0
sumz = 0
while True:
	for i in range(indez + 1):
		sumz += i
	if n - sumz >= 0:
		res += 1
		indez += 1
	else:
		break
print(res)


n = int(input())
r = m = 1
while True:
	if (r + 1) * (r + 2) // 2 + m <= n:
		r += 1
		m += r * (r + 1) / 2
	else:
		print(r)
		exit()


n = int(input())
ans = 1
f = 2
g = 1
l = 1
if n == 1:
	print(ans)
else:
	while True:
		g += f
		l += g
		ans += 1
		if l == n:
			print(ans)
			break
		elif l > n:
			print(ans - 1)
			break
		else:
			f += 1


import math
n = int(input())
total = 0
count = 0
while total < n:
	count += 1
	total += count * (count + 1) // 2
if total > n:
	print(count - 1)
else:
	print(count)


n = int(input())
height = 0
cnt = 1
totalCnt = 1
i = 1
while totalCnt <= n:
	cnt = cnt + (i + 1)
	totalCnt += cnt
	height += 1
	i += 1
print(height)


n = int(input())
height = boxesUsed = prevBoxes = 0
while n > boxesUsed:
	height += 1
	thisStepBoxes = prevBoxes + height
	boxesUsed += thisStepBoxes
	prevBoxes = thisStepBoxes
	if n < boxesUsed:
		height -= 1
print(height)


n = int(input())
current = 0
s = 0
result = 0
for i in range(1, 10000):
	current += i
	if s + current <= n:
		s += current
		result = i
	else:
		break
print(result)


j = int(input())

def layers():
	n = 1
	cubes = 0
	while True:
		cubes += n
		yield cubes
		n += 1

def pyramids(total_cubes):
	for (layer_num, cubes) in enumerate(layers()):
		total_cubes -= cubes
		if total_cubes < 0:
			return layer_num
print(pyramids(j))


n = int(input())
check = 0
count = 0
for i in range(1, 100000):
	check = check + i
	if n >= check:
		n -= check
		count += 1
	if n < check:
		print(count)
		break


n = int(input())
count = n
i = 1
length = 1
while count >= length:
	count -= length
	i += 1
	length += i
print(i - 1)


i = int(input())
k = 0
p = 0
k1 = k
while i > 0:
	p += 1
	k1 += 1
	k = k + k1
	i -= k
if i < 0:
	p = p - 1
print(p)


k = int(input())
(b, c, s) = (1, 0, 2)
while k - b >= 0:
	k = k - b
	b = b + s
	s = s + 1
	c = c + 1
print(c)


def val(n):
	return n * (n + 1) * (n + 2) // 6
x = int(input())
c = 0
su = 0
n = 1
while c == 0:
	if val(n + 1) > x:
		c = 1
	else:
		n += 1
print(n)


n = int(input())
add = 0
i = 1
alll = 0
allll = 0
while allll < n:
	add = add + 1
	alll = alll + add
	allll = allll + alll
if allll == n:
	print(add)
else:
	print(add - 1)


n = int(input())
curr_cubes = 1
level = 1
acc = 2

def total(n):
	cnt = 0
	for i in range(1, n + 1):
		cnt += i
	return cnt
while True:
	s = total(level + 1)
	if curr_cubes + s <= n:
		level += 1
		curr_cubes += s
	else:
		break
print(level)


n = int(input())
s = 0
height = 0
x = 1
while s + x <= n:
	height += 1
	x += height
	s += x
print(height)


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


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


n = int(input())
h = 0
ch = 0
while ch <= n:
	h += 1
	ch += h * (h + 1) / 2
print(h - 1)


n = int(input())
i = 0
summa = 0
count = 0
while n > summa:
	i = i + 1
	count = count + i
	summa = summa + count
	if n < summa:
		i = i - 1
print(i)


n = int(input())
(cnt, c, i) = (0, 0, 1)
j = 0
while 1:
	cnt = cnt + i
	i += 1
	j += 1
	c += cnt
	if c == n:
		z = 0
		break
	elif c > n:
		z = 1
		break
if z:
	print(j - 1)
else:
	print(j)


n = int(input())
i = 0
m = 1
while i < n:
	c = m * (m + 1) // 2
	i = i + c
	m = m + 1
if i == n:
	print(m - 1)
elif i > n:
	print(m - 2)


cubs = int(input())
rashod = 0
i = 0
while cubs > 0:
	i += 1
	rashod = rashod + i
	cubs = cubs - rashod
if cubs < 0:
	print(i - 1)
else:
	print(i)


a = int(input())
l = 0
i = 0
c = 0
while a > 0:
	i = i + 1
	c = l + i
	l = c
	a -= c
	if a < 0:
		i = i - 1
print(i)


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


a = int(input())
k = 0
n = 1
m = 2
while a > 0:
	a -= n
	n += m
	m += 1
	if a >= 0:
		k += 1
print(k)


n = int(input())
s = 0
i = 0
while s <= n:
	i += 1
	sum = 0
	for j in range(1, i + 1):
		sum = sum + j
	s = s + sum
print(i - 1)


test = '25'
(n,) = map(int, input().split())
l = 1
cubes_in_layer = 1
while n >= cubes_in_layer:
	n -= cubes_in_layer
	l += 1
	cubes_in_layer += l
print(l - 1)


n = int(input())
i = 1
total = 1
next = 2
prev = 1
while total + prev + next <= n:
	total += prev + next
	prev += next
	next += 1
	i += 1
print(i)


n = int(input())
x = n
y = 0
j = 0
for i in range(1, n + 1):
	j += i
	if x == 0 or x < j:
		break
	x -= j
	y += 1
print(y)


N = float(input())
v3N = 3.0 * N
sq = (v3N ** 2 - 1.0 / 27.0) ** 0.5
v1o3 = 1.0 / 3.0
L = (v3N + sq) ** v1o3 + (v3N - sq) ** v1o3 - 1
print(int(L + 1e-06))


n = int(input())
sum1 = 0
height = 0
arr = []
count = 0
k = 1
if n == 1:
	print(1)
	exit()
while count != 1:
	arr.append(k)
	sum1 += sum(arr)
	if sum1 > n:
		count = 1
		break
	height += 1
	k += 1
print(height)


n = int(input())
x = list(range(1, n + 1))
p = 1
while n > 0:
	n -= sum(x[:p])
	if n - sum(x[:p + 1]) < 0:
		break
	p += 1
print(p)


n = int(input())
(solution, level, cube) = (0, 1, 2)
while True:
	n -= level
	if n >= 0:
		level += cube
		cube += 1
		solution += 1
	else:
		break
print(solution if solution > 0 else 1)


n = int(input())
cnt = 0
for i in range(10000):
	cnt += i * (i + 1) / 2
	if cnt > n:
		print(i - 1)
		exit()


i = int(input())
c = 0
while i > 0:
	c += 1
	i -= sum([i for i in range(1, c + 1)])
if i < 0:
	c -= 1
print(c)


n = int(input())
c = 0
i = 0
bloc = 0
while n > 0:
	i += 1
	bloc = bloc + i
	if n < bloc:
		break
	else:
		n = n - bloc
		c += 1
print(c)


n = int(input())
h = 0

def get_cube(level):
	sum_cube = 0
	for i in range(level + 1):
		sum_cube += i
	return sum_cube
while n > 0:
	h += 1
	n -= get_cube(h)
	if n < 0:
		h = h - 1
print(h)


def input_split(f):
	return map(f, input().split())

def main():
	n = int(input())
	i = 0
	total = 0
	while True:
		i += 1
		total += sum(range(i + 1))
		if total > n:
			i -= 1
			break
	print(i)
main()


a = int(input())
cube = 1
dem = 1
tong = 1
if a == 1:
	print(dem)
else:
	for i in range(2, a + 1, 1):
		cube = cube + i
		tong = tong + cube
		dem = dem + 1
		if tong > a:
			print(dem - 1)
			break


n = int(input())
mh = 1
f_c = 0
while n > 0:
	f_n = mh + f_c
	if f_n > n:
		mh -= 1
		break
	elif f_n == n:
		break
	f_c = f_n
	mh += 1
	n -= f_c
print(mh)


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


n = int(input())
k = 0
t = 1
while k <= n:
	for i in range(t):
		k = k + (i + 1)
	t = t + 1
print(t - 2)


n = int(input())
lvl = 0
acc = 0
while acc + lvl * 2 + 1 <= n:
	n -= acc + lvl * 2 + 1
	acc += lvl
	lvl += 1
print(lvl)


n = int(input())
arr = []
(s, i, prev) = (0, 1, 0)
while s + prev <= 10 ** 4:
	s += i
	arr.append(s + prev)
	i += 1
	prev = arr[-1]
arr.append(s + prev)
(lb, ub, flag) = (0, len(arr) - 1, 0)
while lb <= ub:
	mid = (lb + ub) // 2
	if arr[mid] == n:
		flag = 1
		break
	elif arr[mid] > n:
		ub = mid - 1
	else:
		lb = mid + 1
if flag == 1:
	print(mid + 1)
else:
	print(lb)


def sum(n):
	res = 0
	for i in range(1, n + 1):
		res += i
	return res
n = int(input())
res = 0
while n > 0:
	res += 1
	n -= sum(res)
print(res - 1 if n < 0 else res)


n = int(input())
x = 0
k = 0
y = 0
while y <= n:
	k = k + 1
	for i in range(0, k + 1):
		x = x + i
	y = x + y
	x = 0
print(k - 1)


n = int(input())
count = 0
k = 1
while count < n:
	count += k * (k + 1) // 2
	k += 1
if count == n:
	print(k - 1)
else:
	print(k - 2)


n = int(input())
x = 0
now = 0
while n >= 0:
	x += 1
	now += x
	n -= now
print(x - 1)


n = int(input())
k = 0
x = 0
m = 0
if n == 1:
	print(1)
	exit()
while n >= k:
	x = x + 1
	for i in range(1, x + 1):
		k = k + i
print(x - 1)


n = int(input())
sum = 0
s1 = 0
c = 0
for i in range(1, n + 1):
	sum = sum + i
	s1 = s1 + sum
	if s1 > n:
		break
	c += 1
print(c)


def height(h):
	return int(h * (h + 1) / 2)
n = int(input())
a = n
h = 1
while a:
	res = height(h + 1)
	if a - res > 0:
		h += 1
		a -= res
		continue
	else:
		break
print(h)


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


import bisect
l = [1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, 1140, 1330, 1540, 1771, 2024, 2300, 2600, 2925, 3276, 3654, 4060, 4495, 4960, 5456, 5984, 6545, 7140, 7770, 8436, 9139, 9880, 10660]
i = int(input())
if i in l:
	print(l.index(i) + 1)
else:
	print(bisect.bisect_left(l, i))


n = int(input())
(w, m) = (1, 1)
ans = 0
while n >= w:
	ans += 1
	n -= w
	m += 1
	w += m
print(ans)


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


n = int(input())
ans1 = 0
ans2 = 0
ans3 = 0
for i in range(1, n + 1):
	ans1 = ans1 + 1
	ans2 = ans1 + ans2
	ans3 = ans3 + ans2
	if ans3 == n:
		print(i)
		break
	if ans3 > n:
		print(i - 1)
		break


n = int(input())
(d, c, m, i) = (0, 1, 1, 1)
while c <= n:
	d += 1
	i += 1
	m += i
	c += m
print(d)


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())


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
	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
	b2 = 0
	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())
	main(n)
main_input()


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


n = int(input(''))
i = 1
height = 0
sum = 0
p = 0
while i <= n:
	sum = sum + i
	p = p + sum
	if p <= n:
		height += 1
	else:
		break
	i += 1
print(height)


n = int(input())
x = [1]
for i in range(0, n):
	x.append(x[i] + i + 2)
	if sum(x) > n:
		x.remove(x[i] + i + 2)
		break
print(len(x))


a = int(input())
for i in range(500):
	if a >= i * (i + 1) * (i + 2) / 6:
		continue
	else:
		print(i - 1)
		break


n = int(input())
s = 0
i = 1
while s <= n:
	s += sum(range(i))
	i += 1
print(i - 3)


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


n = int(input())
(k, s, count) = (1, 0, 0)
while True:
	s += k * (k + 1) // 2
	if s <= n:
		count += 1
	else:
		break
	k += 1
print(count)


n = int(input())
i = 0
cube = 0
summa = 0
while n > summa:
	i += 1
	cube = i + cube
	summa = summa + cube
	if summa > n:
		i -= 1
print(i)


n = input()
c = 1
d = 0
sum = 0
while 1:
	for i in range(0, c):
		sum = sum + i
	c = c + 1
	if sum > int(n):
		break
	d = d + 1
print(d - 1)


import math
cubes = int(input())
a = []
for n in range(1, cubes):
	a.append(n * (n + 1) // 2)
	n += 1

def numberlist(nums, limit):
	prefix = []
	sum = 0
	for num in nums:
		sum += num
		prefix.append(num)
		if sum > limit:
			return prefix
answeer = numberlist(a, cubes)
if answeer == None:
	print(1)
else:
	print(len(answeer) - 1)


n = int(input())
a = 1
k = [1]
arr = [1]
c = 1
for i in range(2, 90):
	a += i
	k.append(a)
for i in range(len(k) - 1):
	b = c + k[i + 1]
	c = b
	arr.append(b)
for i in range(len(arr)):
	if arr[i] > n:
		print(i)
		break


(n, m) = (int(input()), 1)
while m / 6.0 * (m + 1) * (m + 2) < n:
	m += 1
print([m - 1, m][round(m / 6.0 * (m + 1) * (m + 2)) == n])


s = int(input())
n = 1
while True:
	sum = n * (n + 1) * (2 * n + 4) / 12
	if sum > s:
		break
	n = n + 1
print(n - 1)


n = int(input())
i = 0
wai = 0
while n >= 0:
	i += 1
	wai += i
	n -= wai
print(i - 1)


n = int(input())
s = 1
m = 0
k = [0]
j = 0
if n != 1:
	while j <= n:
		m = m + 1
		k.append(m)
		j = j + sum(k)
	if j > n:
		print(m - 1)
	else:
		print(m)
else:
	print(s)


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


number_of_cubes = int(input())
level = 0
cubes = 0
summa = 0
while summa < number_of_cubes:
	level += 1
	cubes += level
	summa += cubes
	if summa == number_of_cubes:
		print(level)
	elif summa > number_of_cubes:
		print(level - 1)


n = int(input())
(i, m, c) = (1, 0, 0)
while True:
	m += i * (i + 1) // 2
	if m > n:
		print(i - 1)
		break
	i += 1


n = int(input())
k = int((6 * n) ** (1 / 3))
print(k - 1) if k * (k + 1) * (k + 2) > 6 * n else print(k)


x = int(input())
i = 1
k = 0
while x > 0:
	x -= int(i * (i + 1) / 2)
	if x == 0:
		k += 1
		break
	elif x < 0:
		break
	else:
		i += 1
		k += 1
print(k)


n = int(input())
c = 1
x = 0
r = 0
while r < n:
	x += c
	c += 1
	r += x
if r <= n:
	print(c - 1)
else:
	print(c - 2)


cubes = int(input())
i = 1
summary = 0
while True:
	temp = summary + (i + 1) * i / 2
	if temp > cubes:
		print(i - 1)
		break
	else:
		summary = temp
	i = i + 1


cub = int(input())
k = 1
cubsum = 1
answer = 0
while cubsum <= cub:
	k += 1
	cub -= cubsum
	answer += 1
	cubsum += k
print(answer)


sum_n = int(input())
n = 1
while True:
	temp = n * (n + 1) * (n + 2)
	if temp > 6 * sum_n:
		break
	n += 1
print(n - 1)


numCubes = int(input())
neededCubes = 1
z = 2
lines = 0
while numCubes >= neededCubes:
	numCubes -= neededCubes
	neededCubes += z
	z += 1
	lines += 1
print(lines)


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


import sys
import os

def changeStdioToFile():
	path = os.path.dirname(os.path.abspath(__file__))
	sys.stdin = open(f'{path}/input.txt', 'r')
	sys.stdout = open(f'{path}/output.txt', 'w')
t = 1
for _ in range(t):
	n = int(input())
	i = 1
	res = 0
	base = i
	while n - base >= 0:
		n -= base
		i += 1
		res += 1
		base += i
	print(res)


n = int(input())

def sun(n):
	if n == 1:
		return 1
	else:
		return n + sun(n - 1)

def pyr(x):
	l = []
	i = 1
	while sun(i) <= x:
		l.append(sun(i))
		i += 1
	return l

def height(l, n):
	s = int(n)
	r = 0
	for i in l:
		if s - i >= 0:
			s = s - i
			r += 1
	return r
print(height(pyr(n), n))


cubes = int(input())
height = 0
while height * (height + 1) * (height + 2) / 6 <= cubes:
	height += 1
print(height - 1)


n = int(input())
(x, sum, count) = (1, 0, 0)
while 1:
	for i in range(x + 1):
		sum += i
	if sum > n:
		print(count)
		break
	else:
		count += 1
	x += 1


def main(n):
	i = 1
	z = 2
	suma = 1
	l = 0
	while True:
		if suma <= n:
			i += z
			suma += i
			z += 1
			l += 1
		else:
			break
	print(l)
n = int(input())
main(n)


a = int(input())
c = 1
tr = 1
n = 2
s = n * (n + 1) // 2
while tr + s <= a:
	tr = tr + s
	c = c + 1
	n = n + 1
	s = n * (n + 1) // 2
print(c)


n = int(input())
j = 0
i = 0
count = 0
sum = 0
while j < n:
	i = i + 1
	j = j + i
	sum = sum + j
	if sum < n:
		count = count + 1
	elif sum == n:
		count = count + 1
		break
	else:
		break
print(count)


n = int(input())
total = 1
currlevel = 1
lastadded = 1
while total <= n:
	currlevel += 1
	lastadded += currlevel
	total += lastadded
	if total > n:
		currlevel -= 1
print(currlevel)


n = int(input())
k = 0
t = []
for i in range(1, 150):
	k += i
	t.append(k)
d = 0
i = 0
while d <= n:
	d += t[i]
	i += 1
print(i - 1)


n = int(input())
if n < 3:
	print(1)
else:
	k = 1
	s = 1
	t = 1
	for i in range(2, n):
		t += i
		s += t
		k += 1
		if n - s < 0:
			print(k - 1)
			break


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


n = int(input())
x = 1
while True:
	if n - (x + 1) * x / 2 < 0:
		break
	n -= (x + 1) * x / 2
	x += 1
print(x - 1)


n = int(input())
i = 0
if n != 0:
	i = 1
	if n != 1:
		x = 1
		a = 0
		while a < n:
			i = i + 1
			x = x + i
			a = a + x
		i = i - 1
print(i)


n = int(input())
s = 0
if n == 1:
	print(1)
else:
	for i in range(1, n + 1):
		s += 0.5 * i * (i + 1)
		if s > n:
			print(i - 1)
			break
		elif s == n:
			print(i)
			break


n = int(input())
i = 1
d = 0
y = 2
while n >= 0:
	n = n - i
	d = d + 1
	i = i + y
	y = y + 1
print(d - 1)


n = int(input())
ans = 2
n -= 1
flag = 1
while True:
	if n < (ans + 1) * ans // 2:
		break
	n -= (ans + 1) * ans // 2
	ans += 1
print(ans - 1)


n = int(input())
k = 1
h = 0
res = 0
total = 0
while total <= n:
	h += 1
	res += h
	total += res
print(h - 1)


n = int(input())
i = 1
sum = 0
line = 0
while True:
	line += i
	sum += line
	i += 1
	if sum >= n or n - sum < line + i:
		break
print(i - 1)


n = int(input())
sum = 0
c = 0
r = 0
for i in range(1, n + 1):
	sum = sum + i
	c = sum + c
	if c <= n:
		r = r + 1
print(r)


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


n = int(input())
level = 1
while n > 0:
	n -= level * (level + 1) // 2
	level += 1
print(level - 1) if n == 0 else print(level - 2)


n = int(input())
sum1 = 0
x = 0
for x in range(0, n + 1):
	if sum1 + (x + 1) * (x + 2) / 2 > n:
		print(x)
		break
	else:
		sum1 += (x + 1) * (x + 2) / 2


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


n = int(input())
a = 1
b = 1
s = 1
while s <= n:
	b = b + 1
	a = a + b
	s = s + a
print(b - 1)


n = int(input())
k = v = 1
while n > 0:
	k += 1
	v += k
	n -= v
print(k - 1)


n = int(input())
t = 0
sh = 0
X = 0
for i in range(1, 100):
	X += i
	sh += X
	t += 1
	if sh > n:
		break
print(t - 1)


li = [1]
x = 1
for i in range(1, 500):
	x += 1
	li.append(li[i - 1] + x)
n = int(input())
cnt = 0
for i in range(500):
	n -= li[i]
	cnt += 1
	if n == 0 or n < li[i + 1]:
		break
print(cnt)


def arrsum(x):
	sum = 0
	for i in range(1, x + 1):
		sum = sum + i
	return sum
a = int(input())
k = 0
l = 0
i = 1
while l + arrsum(i) <= a:
	k = k + 1
	l = l + arrsum(i)
	i = i + 1
print(k)


n = int(input())
y = 1
k = x = 0
(p, count) = (0, 0)
while k <= n:
	x = x + y
	k = k + x
	p = count
	count += 1
	y += 1
print(p)


x = int(input())
n = 1
while x >= n * (n + 1) * (2 * n + 4) // 12:
	n += 1
print(n - 1)


n = int(input())
s = 0
dp = []
for i in range(1000):
	dp.append((1 + i) * i // 2)
for i in range(1, 1000):
	s += dp[i]
	if s > n:
		print(i - 1)
		break


n = int(input())
row = 1
(total, height) = (0, 0)
while True:
	if total + row > n:
		break
	total += row
	height += 1
	row += height + 1
print(height)


n = int(input())
i = 0
kolichestvo = 0
summa = 0
while n >= kolichestvo:
	i += 1
	summa = summa + i
	kolichestvo = kolichestvo + summa
print(i - 1)


n = int(input())
ct = [0]
i = 1
while sum(ct) < n:
	ct.append(ct[-1] + i)
	if sum(ct) + ct[-1] + i + 1 > n:
		print(i)
		break
	i += 1


def bisectionsearch(L, left, right, k):
	mid = (left + right) // 2
	if right - left == 1:
		return left
	elif L[left] <= k < L[mid]:
		return bisectionsearch(L, left, mid, k)
	elif L[mid] <= k < L[right]:
		return bisectionsearch(L, mid, right, k)
	elif k == L[right]:
		return right
	else:
		return -1
n = int(input())
x = int((6 * n) ** (1 / 3) + 2)
L = [(i + 1) * (i + 2) * (i + 3) // 6 for i in range(x)]
print(bisectionsearch(L, 0, x - 1, n) + 1)


from math import sqrt

def check(temp):
	haha = temp * (temp + 1) * (temp + 2) // 6
	if n >= haha:
		return 1
	else:
		return 0
n = int(input())
temp = int(sqrt(n))
lo = 1
high = temp + 1
while lo <= high:
	mid = (lo + high) // 2
	if check(mid):
		ans = mid
		lo = mid + 1
	else:
		high = mid - 1
print(ans)


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


n = int(input())
i = 1
j = 1
levelTotal = 0
allCubes = 0
while True:
	while j <= i:
		levelTotal = levelTotal + j
		j += 1
	allCubes += levelTotal
	if allCubes <= n:
		i += 1
	else:
		i -= 1
		break
print(i)


num = int(input())
sum = 0
c = 0
while sum <= num:
	c += 1
	sum += c * (c + 1) / 2
print(c - 1)


cubes = int(input())
i = 1
total = 0
count = 0
while total <= cubes:
	total = total + i * (i + 1) // 2
	if total <= cubes:
		count = count + 1
		i = i + 1
print(count)


a = int(input())
sum = 0
a1 = 1
k = 1
cnt = 0
if a == 3:
	print('1')
else:
	while a > 0:
		sum = sum + a1
		k = k + 1
		a1 = a1 + k
		cnt = cnt + 1
		a = a - a1
	print(cnt)


n = int(input())
count = 0
(i, delta, stroka, summa) = (0, 0, 0, 0)
while summa < n:
	delta = delta + 1
	stroka = stroka + delta
	summa = stroka + summa
	if summa > n:
		break
	count += 1
print(count)


n = int(input())
level = 1
h = 0
while n >= level:
	n -= level
	h += 1
	level += h + 1
print(h)


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


n = int(input())
col = 0
f = 0
while n > 0:
	col += 1
	f += col
	n -= f
if n == 0:
	print(col)
else:
	print(col - 1)


x = int(input())
(y, h, z) = (1, 0, 1)
while x >= z:
	x -= z
	h += 1
	y += 1
	z += y
print(h)


n = int(input())
no = 1
s = 0
while True:
	s += no * (no + 1) // 2
	if s > n:
		print(no - 1)
		break
	elif s == n:
		print(no)
		break
	no += 1


x = int(input())
k = 0
t = 0
n = 1
while x >= k:
	s1 = int(n * (n + 1) / 2)
	k = k + s1
	t = t + 1
	n = n + 1
print(t - 1)


def f(a):
	if a == 1:
		return 1
	else:
		return f(a - 1) + (a + 1) * a // 2
a = int(input())
i = 1
if a == 1:
	print(1)
else:
	while f(i) <= a:
		i += 1
	print(i - 1)


sum = int(input())
count = 0
temp = 0
total = 0
while True:
	temp += count
	total += temp
	if sum == total:
		break
	elif sum < total:
		count -= 1
		break
	count += 1
print(count)


from sys import stdin
block_number = int(stdin.read().rstrip())
height = 0
width = 1
while block_number >= width:
	height += 1
	block_number -= width
	width += height + 1
print(height)


n = int(input())
c = 0
x = 0
y = 0
if n == 1 or n == 2:
	print('1')
else:
	for i in range(n):
		c += i
		x += c
		y = i
		if x > n:
			break
	print(y - 1)


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


n = int(input())
h = 1
k = 1
while n > h + k + 1:
	h += 1
	n = n - h - k
	k += h
print(h)


n = int(input())
count = 0
total = 0
flag = 0
for i in range(1, n + 1):
	count += i
	total += count
	if total <= n:
		flag += 1
	else:
		break
print(flag)


n = int(input())
count = 0
e = 1
last = 0
while n > 0:
	r = e + last
	n = n - r
	if n < 0:
		break
	else:
		count = count + 1
		last = r
		e = e + 1
print(count)


f = lambda : map(int, input().split())
n = int(input())
(s, i) = (0, 1)
while s <= n:
	s += i * (i + 1) // 2
	i += 1
print(i - 2 if s > n else i - 1)


from sys import setrecursionlimit
setrecursionlimit(10 ** 6)
numCubes = int(input())
cubesPerLevel = 0
totalUsedCubes = 0
level = 1
while cubesPerLevel < numCubes:
	cubesPerLevel = cubesPerLevel + level
	numCubes = numCubes - cubesPerLevel
	if numCubes - cubesPerLevel > level:
		level += 1
print(level)


n = int(input())
c = 0
s = 0
i = 1
while 1:
	s += i * (i + 1) // 2
	if s > n:
		break
	c += 1
	i += 1
print(c)


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


n = int(input())
t = 1
k = 1
while k <= n:
	t += 1
	k = (t * t + t) * (2 * t + 1) / 12 + (t * t + t) / 4
print(t - 1)


a = int(input())
(number, counter, ans) = (0, 0, 0)
while ans <= a:
	counter += 1
	number += counter
	ans += number
print(counter - 1)


n = int(input())
height = 0
cubes = 0
h_line = 0
while cubes <= n:
	height += 1
	h_line += height
	cubes += h_line
print(height - 1)


a = int(input())
i = 0
k = 1
s = 0
if a == 1 or a == 2:
	print('1')
else:
	while a > k:
		i += 1
		k += i + 1
		s += k
		if s >= a:
			break
	print(i)


value = int(input())

def rec(i, x):
	if sum(l) >= value:
		return x
	if value == 1:
		return 1
	i = i + x
	l.append(i)
	rec(i, x + 1)
l = []
rec(1, 2)
print(1 if value == 1 else len(l))


n = int(input())

def func(n):
	return n * (n + 1) * (2 * n + 4) // 12
a = 1
while func(a + 1) <= n:
	a += 1
print(a)


t = int(input())
num_cubes = 1
counter = 1
while t >= num_cubes:
	t = t - num_cubes
	counter = counter + 1
	num_cubes = num_cubes + counter
print(counter - 1)


n = int(input())
k = 0
list1 = [0]
sum1 = sum(list1)
while sum1 <= n:
	list1.append(k * (k + 1) / 2)
	sum1 = sum(list1)
	k += 1
print(k - 2)


n = int(input())
i = 1
levels = 0
sum_of_cubes = 0
while n - sum_of_cubes - i >= 0:
	levels += 1
	sum_of_cubes += i
	n -= sum_of_cubes
	i += 1
print(levels)


availableStones = int(input())
stones = 0
n = 1
height = 0
while stones < availableStones:
	stones += n * (n + 1) // 2
	if stones <= availableStones:
		height += 1
		n += 1
	else:
		break
print(height)


n = int(input())
nlist = []
c = 0
for i in range(100):
	c += i + 1
	nlist.append(c)
d = 0
while True:
	n -= nlist[d]
	if n < 0:
		break
	else:
		d += 1
print(d)


n = int(input())
currentlvl = 1
cubesinrow = 1
vsecubi = 1
height = 1
firstblock = 1
if n < 4:
	print(1)
else:
	while n > vsecubi:
		currentlvl += 1
		cubesinrow = cubesinrow + currentlvl
		vsecubi = vsecubi + cubesinrow
		height += 1
		if vsecubi > n:
			print(height - 1)
		if vsecubi == n:
			print(height)


def pyr(i):
	if i == 0:
		return 0
	if i == 1:
		return 1
	return pyr(i - 1) + i * (i + 1) // 2
a = int(input())
i = 0
while pyr(i + 1) <= a:
	i += 1
print(i)


n = int(input())
height = 0
box = 0
p = 0
while n > box:
	height += 1
	present = p + height
	box += present
	p = present
	if n < box:
		height -= 1
print(height)


n = int(input())
flag = 1
i = 1
t = 0
while flag == 1:
	if n - i * (i + 1) / 2 < 0:
		flag = 0
	else:
		n = n - i * (i + 1) / 2
		t += 1
		i += 1
print(t)


n = int(input())
level = 1
while True:
	n -= level * (level + 1) / 2
	if n < 0:
		level -= 1
		break
	level += 1
print(level)


N = int(input())
level = 1
d = 0
k = 0
while True:
	k += level
	d += k
	if d == N:
		break
	if d > N:
		level -= 1
		break
	level += 1
print(level)


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


n = int(input())
a = 1
s = 1
while n - a >= 0:
	n = n - a
	s += 1
	a = s + a
print(s - 1)


def num(m):
	return m * (m + 1) * (m + 2) / 6
n = int(input())
for i in range(50):
	if num(i) > n:
		print(i - 1)
		break


n = int(input())
total = 0
c = 1
while total <= n:
	for i in range(1, c + 1):
		total += i
	c += 1
if n != 1:
	print(c - 2)
else:
	print(1)


import sys
local_launch = False
try:
	open('LOCAL').read()
	local_launch = True
except:
	pass
input_data = open('INPUT.txt').read() if local_launch else sys.stdin.read()
done = {'i': 0}
tokens = input_data.split()

def next_token():
	result = tokens[done['i']]
	done['i'] += 1
	return result

def next_int():
	return int(next_token())

def next_str():
	return next_token()
n = next_int()
s = n
i = 1

def level(i):
	a = 0
	b = 1
	while b <= i:
		a = a + b
		b = b + 1
	return a
while level(i) <= s:
	s -= level(i)
	i += 1
print(i - 1)


n = int(input())
a = []
s = 0
i = 1
while s < n:
	p = i * (i + 1) // 2
	s = s + p
	if s > n:
		break
	i = i + 1
print(i - 1)


blocks = int(input())
counter = 0
floors = 1
while counter < blocks:
	floors += 1
	counter += floors * (floors + 1) // 2
print(floors - 1)


n = 6 * int(input())
p = 1
while n > p * (p + 1) * (p + 2):
	p += 1
if p * (p + 1) * (p + 2) > n:
	print(p - 1)
else:
	print(p)


n = int(input())
cur = 1
j = 2
s = 1
while s < n:
	cur += j
	j += 1
	s += cur
if s == n:
	print(j - 1)
else:
	print(j - 2)


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	n = I()
	(c, i) = (0, 1)
	while n > 0:
		n -= i * (i + 1) // 2
		if n < 0:
			break
		c += 1
		i += 1
	pf(str(c))
main()


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
i = used = 0
while used <= n:
	i += 1
	used += i * (i + 1) // 2
print(i - 1)


import math
sn = eval(input())
i = 1
c = 0
if sn == 1:
	print(1)
else:
	while sn >= i * (i + 1) // 2:
		sn -= i * (i + 1) // 2
		c += 1
		i += 1
	print(c)


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


__author__ = 'emcenrue'
n = int(input())
s = 1
i = 2
while n >= s:
	n -= s
	s += i
	i += 1
print(i - 2)


x = int(input())
i = 0
j = 0
while True:
	i = i + 1
	j = j + i * (i + 1) // 2
	if x - j < (i + 1) * (i + 2) // 2:
		break
print(i)


n = int(input())
total = 0
level = 1
while total < n:
	total += level * (level + 1) / 2
	level += 1
	if total + level * (level + 1) / 2 > n:
		break
print(level - 1)


n = int(input())
level = 1
levelTotal = 1
total = 1
while total <= n:
	level += 1
	levelTotal += level
	total += levelTotal
print(level - 1)


n = int(input())
s = 0
i = 1
k = 0
a = []
while s < n:
	s = s + i
	a.append(s)
	i = i + 1
b = []
s = 0
for k in a:
	s = s + k
	b.append(s)
k = 0
for i in b:
	if i <= n:
		k = k + 1
if n == 1:
	print(1)
else:
	print(k)


cubes = int(input())
need = 1
i = 1
count = 0
while cubes > 0:
	i = i + 1
	if cubes - need >= 0:
		count = count + 1
		cubes = cubes - need
	else:
		break
	need = need + i
print(count)


n = int(input())
sufficient = True
height = 0
while sufficient:
	height += 1
	n = n - height * (height + 1) // 2
	if n >= (height + 1) * (height + 2) // 2:
		continue
	else:
		sufficient = False
print(height)


n = int(input())
l = 1
z = 1

def piramid(kol, level, need):
	level += 1
	need = need + level
	kol -= need
	return (kol, level, need)
while n > 0:
	(n, l, z) = piramid(n, l, z)
print(l - 1)


n = int(input())
k = 1
s = 0
while 1:
	if s + k * (k + 1) // 2 > n:
		print(k - 1)
		break
	elif s + k * (k + 1) // 2 == n:
		print(k)
		break
	else:
		s += k * (k + 1) // 2
		k += 1


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


(n, ans, k, j) = (int(input()), 1, 1, 1)
while n >= ans + j + k + 1:
	ans += j + k + 1
	j += k + 1
	k += 1
print(k)


def sumaaritmetica(n):
	return n * (n + 1) / 2

def sumadesumas(n):
	if n == 1:
		return 1
	return sumaaritmetica(n) + sumadesumas(n - 1)
cubos = int(input())
i = 1
while cubos - sumadesumas(i) >= 0:
	i += 1
print(i - 1)


N = int(input())
i = 1
while N > 0:
	S = i * (i + 1) / 2
	if N - S >= 0:
		N -= S
		i += 1
	else:
		break
print(i - 1)


a = int(input())
level = 1
cubes = 1
while cubes <= a:
	a -= cubes
	level += 1
	cubes = int(level * (level + 1) / 2)
print(level - 1)


def f(x):
	return x * (x + 1) // 2
n = int(input())
i = 0
while n >= 0:
	n -= f(i + 1)
	i += 1
print(i - 1)


n = int(input())
a = [0]
for i in range(1, 100):
	num = (i + 1) * (i + 1) * i / 2 - i * (i + 1) * (2 * i + 1) / 6
	a.append(num)
for i in range(1, 100):
	if n >= a[i] and n < a[i + 1]:
		print(i)
		break


n = int(input())
c = 0
k = 0
for i in range(1, n + 1):
	c = sum([int(x) for x in range(1, i + 1)])
	k += c
	if k >= n:
		if k > n:
			print(i - 1)
		else:
			print(i)
		exit()


n = int(input())
counter = 0
for i in range(1, 1000):
	n -= (i + 1) * i // 2
	if n < 0:
		print(counter)
		break
	counter += 1


def sm(i):
	return i * (i + 1) // 2
n = int(input())
i = 1
while 1 < 2:
	if n == sm(i):
		print(i)
		break
	elif n < sm(i):
		print(i - 1)
		break
	else:
		n -= sm(i)
		i += 1


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


n = int(input())
i = 1
x = 0
while 1:
	x += i * (i + 1) / 2
	if x == n:
		print(i)
		break
	elif x > n:
		print(i - 1)
		break
	i += 1


n = int(input(''))
k = 1
h = 0
while n >= k * (k + 1) // 2:
	h += 1
	n -= k * (k + 1) // 2
	k += 1
print(h)


n = int(input())
for i in range(1, 100):
	ans = i * (i + 1) * (i + 2) / 6
	if ans > n:
		print(i - 1)
		break


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest
from math import ceil, floor, log, log2, sqrt, gcd, factorial

def binNumber(n, size=1):
	return bin(n)[2:].zfill(size)

def iar():
	return list(map(int, input().split()))

def ini():
	return int(input())

def isp():
	return map(int, input().split())

def sti():
	return str(input())
n = ini()
s = 0
i = 1
while True:
	x = i * (i + 1) // 2
	s += x
	if s > n:
		print(i - 1)
		quit()
	i += 1


__author__ = 'Dilshod'
n = int(input())
cnt = 0
a = 0
i = 1
while a + i <= n:
	a += i
	cnt += 1
	n -= a
	i += 1
print(cnt)


n = int(input())
l = []
s = 0
if n == 1:
	print('1')
else:
	for i in range(1, n + 1):
		l.append(i * (i + 1) // 2)
	for i in range(len(l)):
		s = s + l[i]
		if s > n:
			print(i)
			break


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


a = int(input())
b = 0
c = []
for i in range(1, 151):
	b = b + i
	c.append(b)
d = 0
e = 0
for j in c:
	if e <= a:
		e = e + j
		d = d + 1
if d == 1:
	print(1)
else:
	print(d - 1)


n = int(input())
x = 0
y = 0
z = 1
while n > 0:
	n = n - (x + 1)
	if n < 0:
		break
	y = y + 1
	z = z + 1
	x = x + z
print(y)


input_s = int(input())
s = 0
b = 0
i = 0
while s <= input_s:
	i += 1
	b += i
	s += b
print(i - 1)


p = int(input())
i = 1
k = 1
m = 2
if p == 1:
	print(p)
else:
	while 1:
		g = m * (m + 1) / 2
		i += g
		if i > p:
			break
		m = m + 1
		k = k + 1
	print(k)


cubes = int(input())
height = 0
while True:
	if cubes >= (height + 1) * height / 2:
		cubes = cubes - (height + 1) * height / 2
		height = height + 1
	else:
		break
print(height - 1)


n = int(input())
sum = 1
l = [1]
if n == 1:
	print(1)
for i in range(1, n):
	l.append(l[i - 1] + i + 1)
	sum += l[i]
	if sum > n:
		print(i)
		break
	elif sum == n:
		print(i + 1)
		break


x = int(input())
y = 0
l = 0
while x >= y:
	y += l * (l + 1) // 2
	l += 1
print(l - 2)


a = int(input())
cnt = 0
b = []
c = 0
while cnt <= a:
	b.append(c)
	cnt = cnt + sum(b)
	c += 1
print(c - 2)


cur_cubes = int(input())
count = 1
cubes_level = 0
while True:
	cubes_level += count
	cur_cubes -= cubes_level
	count += 1
	if cur_cubes == 0:
		count = count - 1
		break
	elif cur_cubes < 0:
		count = count - 2
		break
print(count)


n = int(input())
height = 0
cups = 0
while n > 0:
	height += 1
	cups += height
	n -= cups
if n < 0:
	print(height - 1)
else:
	print(height)


j = int(input())

def pyramids():
	if j == 1:
		print(1)
		return
	k = 0
	l = []
	for i in range(1, j + 1):
		k = k + i
		l.append(k)
	desired = int()
	i = 0
	while desired <= j:
		desired += l[i]
		i += 1
	print(i - 1)
pyramids()


def solve():
	c = 0
	n = int(input())
	a = 0
	i = 1
	x = 0
	while a + i * (i + 1) // 2 <= n:
		c += 1
		a += i * (i + 1) // 2
		i += 1
	print(c)
solve()


n = int(input())
h = 1
l = 1
while l <= n:
	n -= l
	h += 1
	l += h
print(h - 1)


n = int(input())
s = 0

def lj(x):
	s = 0
	for i in range(1, x + 1):
		s += i
	return s
for i in range(1, 100):
	lll = lj(i)
	if n >= lll:
		n -= lll
		t = i
	if n < 0:
		break
print(t)


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


n = int(input())
r = 0
i = 0
j = 1
while r < n:
	i += j
	j += 1
	r += i
if r == n:
	print(j - 1)
else:
	print(j - 2)


n = int(input())
sum = 0
count = 0
for i in range(1, n + 1):
	sum = i * (i + 1) / 2 + sum
	if sum <= n:
		count += 1
	elif sum > n:
		break
print(count)


n = int(input())

def getVal(k):
	s1 = k * (k + 1) * (2 * k + 1) / 6
	s2 = k * (k + 1) / 2
	return int((s1 + s2) / 2)

def findVal(start, end):
	if end - start < 2:
		if getVal(end) <= n:
			return end
		return start
	mid = int((start + end) / 2)
	if getVal(mid) > n:
		return findVal(start, mid - 1)
	else:
		return findVal(mid, end)
print(findVal(1, n))


n = int(input())
i = 0
current = 0
last = 0
while n > 0:
	i += 1
	current = last + i
	last = current
	n = n - current
	if n < 0:
		i -= 1
print(i)


n = int(input())
lvl = 1
if n == 1:
	print(1)
else:
	while n >= 0:
		a = int(0.5 * lvl ** 2 + 0.5 * lvl)
		n -= a
		if n >= 0:
			lvl += 1
		else:
			lvl = lvl - 1
			break
	print(lvl)


n = int(input())
n1 = n
flag = 0
m = 0
s = 0
c = 0
while flag != 1:
	m = m + 1
	k = 0
	for i in range(1, m + 1):
		s = s + i
		z = s
		k = k + 1
	n = n - k
	if s <= n1:
		c = c + 1
	if s > n1:
		flag = 1
print(c)


n = int(input())
temp = 2
while n >= sum(range(1, temp)):
	n -= sum(range(1, temp))
	temp += 1
print(temp - 2)


n = int(input())
k = 0
m = 0
z = 0
for i in range(10000):
	k += i
	m += k
	z += 1
	if m > n:
		break
print(z - 2)


n = int(input())
ch = 1
k = 1
t = 1
while ch <= n:
	k += 1
	t += k
	ch += t
print(k - 1)


n = int(input())
h = 0
p = 0
while n > h + p:
	h = h + 1
	p = h + p
	n = n - p
print(h)


n = int(input())
a = [1]
b = 1
h = 0
while b / n <= 1:
	a.insert(a[-1], int(a[-1]) + 1)
	b = b + sum(a)
	h += 1
print(h)


n = int(input())
uroven = 0
izmenenie = 0
while n > 0:
	uroven += 1
	izmenenie = uroven + izmenenie
	n = n - izmenenie
	if n < 0:
		print(uroven - 1)
		break
else:
	print(uroven)


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


import math
__author__ = 'runekri3'
cubes = int(input())
height = 1
cur_cubes = 1
while cubes >= cur_cubes:
	height += 1
	cur_cubes += height * (height + 1) // 2
height -= 1
print(height)


n = int(input())
l = [0] * 100001
l[1] = 1
c = 1
i = 2
while 1:
	l[i] = l[i - 1] + i * (i + 1) // 2
	if l[i] > n:
		break
	else:
		c += 1
	i += 1
print(c)


n = int(input())
height = 0
cubes = 0
i = 0
total_cubes = 0
while total_cubes <= n:
	height += 1
	cubes += height
	total_cubes += cubes
	if total_cubes > n:
		height -= 1
print(height)


nl = [1]
n = int(input())
[nl.append(nl[-1] + x) for x in range(2, 100000) if sum(nl) <= n]
print(len(nl) - 1)


s = int(input())
height = 0
num_current_height = 1

def get_current_heigh(index):
	count = 0
	for i in range(index + 1):
		count += i
	return count
while s >= 0:
	s -= get_current_heigh(height + 1)
	height += 1
print(height - 1)


i = 0
var = int(input())
while var > 0:
	i += 1
	var -= i * (i + 1) // 2
if var == 0:
	print(i)
else:
	print(i - 1)


def func(n):
	l = 0
	req = 1
	while n > 0:
		l += 1
		req = (l + 1) * (l + 2) // 2
		n -= req
	return l
n = int(input())
print(func(n))


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


n = int(input())

def ss(n):
	if n == 1:
		return 1
	return ss(n - 1) + n * (n + 1) / 2
q = True
j = -1
while q:
	j += 1
	if ss(j + 1) > n:
		exit(print(j))


n = int(input())
(i, h, su) = (2, 1, 1)
n = n - 1
while 1:
	su = su + i
	if su > n:
		break
	else:
		h += 1
		n = n - su
	i += 1
print(h)


x = int(input())
(t, m) = (0, 0)
while x >= t:
	m += 1
	t = m * (m + 1) * (m + 2) / 6
print(m - 1)


n = int(input())

def y(x):
	y = x * (1 + x) / 2
	return y
i = 1
sum = 0
while 1:
	sum += y(i)
	if sum <= n:
		i += 1
	else:
		break
print(i - 1)


n = int(input())
i = 0
k = 1
count = 0
while i <= n:
	i += k
	if i <= n:
		count += 1
		k += count + 1
	else:
		break
print(count)


count = 0
step = 0
s = 0
n = int(input())
for i in range(1, n + 1):
	if count + i <= n - s:
		count = count + i
		step = step + 1
		s = s + count
	else:
		break
print(step)


f = [1] + [0] * 100
for i in range(2, 100):
	f[i - 1] = f[i - 2] + i
n = int(input())
ans = 0
for k in range(len(f)):
	n -= f[k]
	ans += 1
	if n < f[k + 1]:
		print(ans)
		break


num_cubes = int(input())
n = 0
while (n + 1) * (n + 2) * (n + 3) / 6 <= num_cubes:
	n += 1
print(n)


n = int(input())
heightOfPyramid = 0
cubesOfPyramid = 0
step = 1
while True:
	cubes = 0
	for i in range(1, step + 1):
		cubes += i
	cubesOfPyramid += cubes
	if cubesOfPyramid > n:
		break
	else:
		step += 1
		heightOfPyramid += 1
print(heightOfPyramid)


x = int(input())
sum = 0
count = 0
sum1 = 0
i = 1
while sum < x:
	sum1 = sum1 + i
	sum = sum + sum1
	if sum > x:
		break
	i = i + 1
	count = count + 1
print(count)


def main():
	n = int(input().strip())
	step = sstp = 0
	for h in range(1000):
		sstp += 1
		step += sstp
		if n < step:
			return h
		n -= step
print(main())


n = int(input())
i = 0
h = 0
count = 0
while count < n:
	h += 1
	i += h
	count += i
if count == n:
	print(h)
else:
	print(h - 1)


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)


n = int(input())
ans = 0
index = 1
for i in range(1, n):
	if ans + i * (i + 1) // 2 <= n:
		ans += i * (i + 1) // 2
		index = i
	else:
		break
print(index)


cube = int(input())
level = 0
out = 1
if cube == 1:
	level = 1
else:
	while cube > 0:
		out += 1
		cout = 0
		for i in range(out):
			cout += i
		cube -= cout
		if cube >= 0:
			level += 1
print(level)


n = int(input())
h = 0
r = n
for i in range(1, n + 1):
	x = i * (i + 1) // 2
	if r < x:
		break
	else:
		h = h + 1
		r = r - x
print(h)


n = int(input())
x = 1
y = 1
ans = 0
while True:
	ans += 1
	n -= y
	x += 1
	y += x
	if n < 0:
		ans -= 1
		break
	elif n == 0:
		break
print(ans)


a = int(input())
i = 1
j = 2
s = 0
while a > 0 and a - i >= 0:
	a -= i
	i += j
	j += 1
	s += 1
print(s)


n = int(input())
t = 0
q = 0
cnt = 0
i = 1
if n == 1:
	print(1)
else:
	while n >= q:
		t = t + i
		i = i + 1
		q = q + t
		cnt = cnt + 1
	print(cnt - 1)


n = int(input())
i = 1
ans = 0
current = 0
while n > 0:
	n = n - current - i
	if n < 0:
		break
	else:
		current += i
		ans += 1
		i += 1
print(ans)


n = int(input())
s = 0
t = 0
ret = 0
for i in range(100):
	t += i
	s += t
	if s <= n:
		ret = i
print(ret)


n = int(input())
li = list(range(1, n + 1))
(i, k, s, sumo) = (0, 0, 0, 0)
li2 = []
while True:
	sumo += li[i]
	li2.append(sumo)
	i += 1
	s = 0
	for j in range(len(li2)):
		s += li2[j]
	if s == n:
		k += 1
		break
	if s > n:
		break
	k += 1
print(k)


def main():
	n = int(input())
	count = 0
	i = 1
	while n >= 0:
		sum = i * (i + 1) / 2
		if n - sum >= 0:
			n -= sum
			count += 1
			i += 1
		else:
			break
	print(count)
main()


cubes = int(input())
level = 0
cubes_needed_for_next_level = 1
while cubes_needed_for_next_level <= cubes:
	level += 1
	cubes_needed_for_next_level = int(0.5 * ((level + 1) ** 2 + (level + 1)))
	cubes -= int(0.5 * (level ** 2 + level))
print(level)


koll_kybikov = int(input())
Summa_progressii = 0
last_znach = 0
d = 1
pervoe_znachenie = 1
n = last_znach
koll_ryad = 0
Summa_kubikov_v_piramide = 0
while Summa_progressii < koll_kybikov:
	last_znach = last_znach + 1
	n = last_znach
	Summa_progressii = (pervoe_znachenie + last_znach) / 2 * n
	if Summa_kubikov_v_piramide + Summa_progressii > koll_kybikov:
		break
	Summa_kubikov_v_piramide = Summa_kubikov_v_piramide + Summa_progressii
	koll_ryad = koll_ryad + 1
print(koll_ryad)


a = int(input())
total = 0
temp = 0
if a == 1:
	print(a)
if a == 2:
	print(1)
if a == 3:
	print(1)
for i in range(1, a, 1):
	if total < a:
		temp += i
		total += temp
	elif total > a:
		print(i - 2)
		break
	else:
		print(i - 1)
		break


def sumN(n, a, d):
	return n / 2 * (2 * a + (n - 1) * d)
n = int(input())
data = []
i = 1
while True:
	data.append(sumN(i, 1, 1))
	temp = sum(data)
	if temp == n:
		break
	elif temp > n:
		i -= 1
		break
	i += 1
print(i)


n = int(input())
level = 1
kubiki = 0
count = 0
while level <= n:
	count += 1
	level = level + count
	n = n - level
print(count)


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


n = int(input())
i = 0
ct = 0
sm = 0
while sm <= n:
	i = i + 1
	ct = ct + i
	sm = sm + ct
print(i - 1)


n = int(input())
h = 0
k = 1
c = 1
while True:
	if c <= n:
		h += 1
		k += 1
		c += k * (k + 1) // 2
	else:
		break
print(h)


import math

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


n = int(input())
d = {}
for i in range(1, 1000):
	s = 0
	for j in range(1, i + 1):
		s = s + j
	d[i] = s
k = 0
l = 0
f = 0
for i in d.values():
	k = k + i
	if k <= n and f != 1:
		l += 1
	else:
		f = 1
print(l)


import sys

def Calc(N):
	return N * ((N + 1) * 0.5)
N = int(input())
C = 0
for I in range(1000000000000000000):
	C += Calc(I)
	if C == N:
		print(I)
		sys.exit()
	elif C > N:
		print(I - 1)
		sys.exit()


import math

def piramidHeight(n):
	current = 1
	height = 0
	while n > 0:
		n -= current
		height += 1 if n >= 0 else 0
		current += height + 1
	return height
print(piramidHeight(int(input())))


import math as m
n = int(input())
if n == 1:
	print(1)
else:
	boole = False
	arr = [0] * (m.ceil(m.sqrt(n)) + 1)
	for i in range(1, len(arr)):
		arr[i] = arr[i - 1] + i
	sum1 = 0
	for i in range(len(arr)):
		sum1 += arr[i]
		if sum1 > n:
			print(i - 1)
			boole = True
			break
	if not boole:
		print(len(arr) - 1)


cube = int(input())
li = [1, 2]
total = 3
i = 2
count = 1
while cube - total > 0:
	cube = cube - total
	i = i + 1
	li.append(i)
	total = sum(li)
	count = count + 1
print(count)


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


n = int(input())
print(max((i for i in range(100) if i * (i + 1) * (i + 2) // 6 <= n)))


num = int(input())
sum = 0
row = 0
while num > 0:
	row += 1
	sum += row
	num -= sum
if num == 0:
	print(row)
else:
	print(row - 1)


n = int(input())
k = 1
a = 1
while n >= 0:
	n = n - k
	a = a + 1
	k = k + a
print(a - 2)


def calc(x):
	return int(x / 2 * (x + 1))
x = int(input())
h = 0
c = 0
for i in range(1, x + 1):
	c += calc(i)
	h += 1
	if c == x:
		print(h)
		break
	elif c > x:
		print(h - 1)
		break


n = int(input())
i = 1
cube_count = 0
height = 0
while True:
	cube_count += i * (i + 1) / 2
	i += 1
	if cube_count > n:
		break
	height += 1
print(height)


n = int(input())
i = 8 + 10 * len(str(n))
while i * (i + 1) * (i + 2) / 6 > n:
	i -= 1
print(i)


a = int(input())
s = 0
k = 0
for i in range(1, a + 1):
	s += i
	k += s
	x = a - 2 * i
	y = s + i
	if a < k + s + i + 1:
		print(i)
		break


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


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	st = 1
	sm = st
	dn = 1
	inc = 1
	while True:
		inc += 1
		st += inc
		sm += st
		if n < sm:
			return dn
		dn += 1
print(main())


n = int(input())
tot = 1
c = 1
i = 1
while True:
	i += 1
	c += i
	tot += c
	if tot > n:
		i -= 1
		break
print(i)


n = int(input())
i = 1
num = 0
zhong = 0
while n >= num + zhong + i:
	zhong += i
	num += zhong
	i += 1
print(i - 1)


def height(n):
	res = 0
	i = 1
	while True:
		sum_i = i * (i + 1) // 2
		if sum_i <= n:
			res += 1
			i += 1
			n -= sum_i
		else:
			break
	print(res)
n = int(input())
height(n)


n = int(input())
i = 1
j = 1
while j <= n:
	n = n - j
	i = i + 1
	j = j + i
print(i - 1)


x = int(input())
res = 0
co = -1
n = 1
while x >= res:
	res += n * (n + 1) // 2
	n += 1
	co += 1
print(co)


a = int(input())
b = 1
n = 2
d = 1
count = 1
while b <= a:
	d = d + n
	n += 1
	b = b + d
	count += 1
print(count - 1)


n = int(input())
res = 0
i = 1
now = 1
while n >= now:
	n -= now
	res += 1
	i += 1
	now += i
print(res)


import math
n = int(input())
p = int(1)
t = int(1)
k = int(1)
for i in range(2, 10000):
	p += i
	k += p
	if k > n:
		print(t)
		exit(0)
	t += 1


soLuongGach = int(input())
tongGachCanThiet = 1
soGachCanTangHienTai = 1
soTangKimTuThap = 1
while True:
	soTangKimTuThap += 1
	soGachCanTangHienTai += soTangKimTuThap
	tongGachCanThiet += soGachCanTangHienTai
	if int(tongGachCanThiet) > soLuongGach:
		soTangKimTuThap -= 1
		break
print(soTangKimTuThap)


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


n = int(input())
x = 1
сount = 0
while n >= x:
	сount += 1
	x = x + сount
	n -= x
print(сount)


n = int(input())
p = 0
i = 0
ch = 1
while n >= ch:
	i += 1
	ch += i
	n -= ch
print(i)


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


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


n = int(input())
count = 1
spend = 1
for i in range(2, n + 1):
	spend += i * (i + 1) // 2
	if spend > n:
		break
	count += 1
print(count)


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)


cubes = int(input())
previous_c = 0
current_c = 0
layer_count = 0
total_used = 0
for i in range(cubes):
	layer_count = layer_count + 1
	previous_c = previous_c + 1
	current_c = current_c + previous_c
	total_used = total_used + current_c
	if cubes < total_used:
		layer_count = layer_count - 1
		break
print(layer_count)


n = int(input())
count = 0
a = 0
while n >= 0:
	count += 1
	a = a + count
	n = n - a
print(count - 1)


n = int(input())
counter = 1
num_blocks = 0
while True:
	res = counter * (counter / 2) + counter / 2
	num_blocks += res
	if num_blocks > n:
		print(counter - 1)
		break
	elif num_blocks == n:
		print(counter)
		break
	counter += 1


n = int(input())
blocks = 0
height = 1
while True:
	num = height * (height + 1) // 2
	if num + blocks > n:
		break
	blocks += num
	height += 1
print(height - 1)


def trial():
	num = int(input())
	levels = []
	for i in range(1, num + 1):
		counter = 0
		for j in range(i + 1):
			counter += j
			if counter >= num:
				levels.append(counter)
				break
			elif counter < num and counter not in levels:
				levels.append(counter)
		if levels[-1] > num:
			break
	levels.pop(0)
	if len(levels) == 1:
		return print(1)
	res = 0
	counter = 0
	for i in levels:
		if res < num:
			counter += 1
			res += i
			if res > num:
				counter -= 1
				return print(counter)
		else:
			return print(counter)
	return print(counter)
trial()


n = int(input())
amount = 0
k = 0
c = 1
i = 2
while amount <= n:
	amount += c
	if amount <= n:
		k += 1
	c += i
	i += 1
print(k)


n = int(input())
m = 1
M = 10 ** 14
mid = (m + M) // 2
s = mid * (mid + 1) // 2
s1 = (mid + 1) * (mid + 2) * (mid + 3) // 6
while not (s <= n and s1 > n):
	mid = (m + M) // 2
	s = mid * (mid + 1) * (mid + 2) // 6
	s1 = (mid + 1) * (mid + 2) * (mid + 3) // 6
	if s < n and s1 < n:
		m = mid
	elif s > n:
		M = mid
	else:
		break
if s1 > n:
	print(mid)
else:
	print(mid + 1)


n = int(input())
levels = 0
i = 1
while True:
	num_of_cubes = i * (i + 1) // 2
	if n < num_of_cubes:
		break
	n -= num_of_cubes
	levels += 1
	i += 1
print(levels)


cubes = int(input())
sum = 0
n = 1
while 1 < 2:
	if sum >= cubes:
		break
	sum = 0
	for x in range(1, n + 1):
		sum_y = 0
		for y in range(1, x + 1):
			sum_y += y
		sum += sum_y
	n += 1
if sum <= cubes:
	print(n - 1)
else:
	print(n - 2)


def solve(n, depth):
	k = depth * (depth + 1) / 2
	return depth - 1 if n < k else solve(n - k, depth + 1)
print(solve(int(input()), 1))


def sum_def(n):
	out = 0
	for i in range(1, n + 1):
		for i in range(1, i + 1):
			out += i
	return out
n = int(input())
sum_tmp = 0
c = 0
while sum_tmp <= n:
	sum_tmp = sum_def(c + 2)
	c += 1
print(c)


n = int(input())
count = height = total = 0
for i in range(1, n + 1):
	count += i
	total += count
	if total > n:
		break
	height += 1
print(height)


z = int(input())
lst = []
a = 1
x = 0
while x <= z:
	lst.append(a)
	x = x + sum(lst)
	a += 1
print(a - 2)


n = int(input())
current = 0
cntr = 0
last = 0
while n > 0:
	cntr += 1
	current = cntr + last
	last = current
	n -= current
	if n < 0:
		cntr -= 1
print(cntr)


l = []
s = 0
for i in range(1, 100):
	s += i
	l.append(s)
n = int(input())
s = 0
for (i, k) in enumerate(l):
	s += k
	if s > n:
		break
print(i)


n = int(input())
(s, d, r) = (0, 0, 0)
for i in range(1, n + 1):
	s = s + i
	d += s
	if d > n:
		break
	if d == n:
		r = r + 1
		break
	r = r + 1
print(r)


def dp(n):
	temp = 0
	dp = []
	for i in range(1, n + 1):
		temp += i
		if temp > n:
			break
		n -= temp
		dp.append(temp)
	return len(dp)
n = int(input())
print(dp(n))


All = int(input())
n = r = 0
while r <= All:
	n += 1
	r += (2 + (n - 1)) * n // 2
print(n - 1)


n = int(input())
i = 1
j = 2
count = 0
while n > 0:
	if i > n:
		break
	n = n - i
	i = i + j
	j = j + 1
	count = count + 1
print(count)


n = int(input())
line = 0
cubes = 0
res = 0
for i in range(1, n + 1):
	line += i
	cubes += line
	if cubes <= n:
		res += 1
	else:
		break
print(res)


n = int(input())

def sumof(n):
	return n * (n + 1) // 2
i = 1
s = 0
count = 0
while s <= n:
	s += sumof(i)
	count += 1
	if s + sumof(i + 1) <= n:
		i += 1
	else:
		break
print(count)


n = int(input())
c = 0
i = 1
x = 0
while n > c and n > 0:
	if n - c - i >= 0:
		c = c + i
		i = i + 1
		n = n - c
		x = x + 1
	else:
		break
print(x)


n = int(input())
total = 0
i = 1
b = 1
while total <= n:
	total += b
	i += 1
	b += i
print(i - 2)


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


def f(x):
	ret = 0
	delta = 0
	sz = 0
	while True:
		delta += 1
		sz += delta
		if x >= sz:
			x -= sz
			ret += 1
		else:
			return ret
print(f(int(input())))


def sqrt(x):
	return x ** 0.5
x = int(input())
n = -1 + 1 / (3 ** (1 / 3) * (27 * x + sqrt(3) * sqrt(-1 + 243 * x ** 2)) ** (1 / 3)) + (27 * x + sqrt(3) * sqrt(-1 + 243 * x ** 2)) ** (1 / 3) / 3 ** (2 / 3)
print(int(round(n, 10)))


inp = int(input())
count = 0
sub = 1
num = 1
while inp > 0 and inp >= sub:
	inp -= sub
	num += 1
	sub += num
	count += 1
print(count)


n = int(input())
i = 1
l = 0
while 1:
	s = (i * (i + 1) * (2 * i + 1) // 6 + i * (i + 1) // 2) // 2
	if s <= n:
		l += 1
		i += 1
	else:
		print(l)
		break


n = int(input())
i = 1
len = 1
sum = 1
while n >= sum:
	i += 1
	len += i
	sum += len
print(i - 1)


n = int(input())
i = 1
j = 2
while n >= i:
	n = n - i
	if n >= i + j:
		i = i + j
		j += 1
	else:
		break
print(j - 1)


n = int(input())
sum = 0
for i in range(1, 10000):
	sum = sum + (1 + i) * i / 2
	if sum > n:
		print(i - 1)
		break


cubes = int(input())
sum = 0
n = 0
level = 0
while cubes > level:
	n += 1
	sum += n
	level += sum
if cubes == level:
	print(n)
else:
	print(n - 1)


x = int(input())
n = 0
b = 1
while x >= b:
	n += 1
	b += n
	x = x - b
print(n)


import itertools

def main():
	n = int(input())
	s = 0
	cur = 1
	d = 0
	while True:
		if s + cur > n:
			break
		s += cur
		cur += d + 2
		d += 1
	print(d)
main()


from sys import stdin
n = int(stdin.readline().rstrip())
i = 1
while n > 0:
	n -= 0.5 * i * (i + 1)
	i += 1
print(i - 1 - int(n < 0))


n = int(input())
floor = [1]
while True:
	if sum(floor) > n:
		print(len(floor) - 1)
		exit(0)
	else:
		floor1 = len(floor) + 1
		floor.append((floor1 * floor1 + floor1) // 2)


import math
num = int(input())
ans = 0
count = 0
for i in range(2, round(math.sqrt(num)) + 2):
	z = i * (i - 1) / 2
	ans = ans + z
	if ans > num:
		break
	else:
		count = count + 1
print(count)


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


a = int(input())
aa = 0
b = 0
s = 0
for i in range(a):
	aa = aa + i + 1
	b = b + aa
	if b <= a:
		s = s + 1
print(s)


i = int(input())
(x, y, z) = (0, 0, 0)
if i == 1:
	print(1)
else:
	for a in range(1, i + 1):
		x += a
		y += x
		if y <= i:
			z = a
		else:
			break
	print(z)


top = int(input())
n = 0
sum1 = 0
while True:
	sum1 += (n * n + n) / 2
	if sum1 > top:
		print(n - 1)
		break
	n += 1


target = int(input())
_sum = 0
for n in range(1, 60):
	_sum += int((n * n + n) / 2)
	if target < _sum:
		print(n - 1)
		break
	else:
		continue


def pyramid(n):
	return n * (n + 1) * (n + 2) / 6
n = int(input())
h = 0
while pyramid(h) <= n:
	h += 1
print(h - 1)


n = int(input())
res = 1
sum = 1
i = 1
while res <= n:
	i += 1
	sum += i
	res += sum
print(i - 1)


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


n = int(input())
for i in range(100):
	if (i + 2) * (i + 1) * i // 6 > n:
		print(i - 1)
		exit(0)
	elif (i + 2) * (i + 1) * i // 6 == n:
		print(i)
		exit(0)


n = int(input())
i = 0
j = 0
k = 0
p = -1
while j <= n:
	k += 1
	i += k
	j += i
	p += 1
print(p)


n = int(input())
s = 0
v = 0
k = 0
for i in range(1, n + 1):
	s = s + i
	v += s
	if v > n:
		break
	elif v == n:
		k = k + 1
		break
	k = k + 1
print(k)


n = int(input())
(lvl, ct) = (1, 1)
while n > 0:
	ct += 1
	lvl += ct
	n -= lvl
print(ct - 1)


n = int(input())
cont = i = 0
while cont < n:
	i += 1
	for j in range(1, i + 1):
		cont += j
if cont > n:
	i -= 1
print(i)


import math

def choose(n, k):
	return math.factorial(n) // (math.factorial(k) * math.factorial(n - k))
x = int(input())
for i in range(1, 100):
	if choose(i + 2, 3) <= x < choose(i + 3, 3):
		print(i)
		break


cubes = int(input())
to = 1
level = 0
while to <= cubes:
	cubes -= to
	to += level + 2
	level += 1
print(level)


n = int(input())
a = 0
b = 0
for i in range(1, n + 1):
	a += i * (i + 1) // 2
	if a <= n:
		b += 1
	elif a > n:
		break
print(b)


n = int(input())
stage = 0
for i in range(1, 1000):
	if n >= sum([k for k in range(i + 1)]):
		stage += 1
		n -= sum([k for k in range(i + 1)])
	else:
		print(stage)
		break


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def no():
	print('NO')
	return

def yes():
	print('YES')
	return

def solve(case_no):
	n = int(input())
	for i in range(1, 10000):
		n -= i * (i + 1) // 2
		if n < 0:
			print(i - 1)
			exit()
t = 1
for i in range(1, t + 1):
	solve(i)


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


n = int(input())
k = 0
m = 0
f = 0
i = 1
while m < n:
	m = i + k
	f = f + m
	k = m
	if f <= n:
		i = i + 1
print(i - 1)


N = int(input())
S = 0
i = 1
A = []
for i in range(0, N):
	S = i * (i + 1) * (2 * i + 1) / 12 + i * (i + 1) / 4
	A.append(S)
for i in range(0, len(A)):
	if A[i] > N:
		print(i - 1)
		break
if A[-1] == 0:
	print(1)
elif A[-1] < N:
	print(len(A) - 1)


n = int(input())
i1 = 1
i2 = 0
p = 0
while n > 0:
	n -= i1 + i2
	if n >= 0:
		p += 1
	i2 = i1 + i2
	i1 += 1
print(p)


inp = input().split(' ')
k = 0
l = []
a = int(inp[0])
h = 0
j = 0
while j <= a:
	h = h + 1
	j = j + h * (h + 1) // 2
print(h - 1)


n = int(input())
x = 1
l = 1
while x <= n:
	l += 1
	x += l * (l + 1) // 2
print(l - 1)


def GH(a, i):
	if a < 0:
		return i - 2
	else:
		return GH(a - i * (i + 1) / 2, i + 1)
print(GH(int(input()), 1))


n = int(input())
a = 0
k = 1
while 1:
	a += k * (k + 1) // 2
	k += 1
	if a > n:
		break
print(k - 2)


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


t = int(input())
i = 2
count = 1
while True:
	if count == t:
		print(i - 1)
		break
	if count > t:
		print(i - 2)
		break
	t = t - count
	count = count + i
	i += 1


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
(prev, tot, i) = (1, 1, 2)
while True:
	if prev == n:
		print(i - 1)
		break
	elif prev > n:
		print(i - 2)
		break
	tot += i
	prev += tot
	i += 1


def solve(n):
	x = 0
	h = 0
	while x <= n:
		x += h * (h + 1) // 2
		h += 1
	return h - 2

def main():
	n = int(input())
	print(solve(n))
main()


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


x = int(input())
k = 0
while k * (k + 1) * (k + 2) <= 6 * x:
	k = k + 1
print(k - 1)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	r = 0
	t = 1
	while n >= t:
		n -= t
		r += 1
		t += r + 1
	return r
print(main())


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


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


lst = []
s = 0
n = int(input())
for i in range(1, 40):
	lst.append(i * (i + 1) // 2)
for i in range(39):
	s += lst[i]
	if n < s:
		print(i)
		break


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


b = int(input())
t = m = 0
while 1:
	if t > b:
		print(m - 1)
		break
	else:
		m += 1
		t += (m ** 2 + m) / 2


n = int(input())
num = 0
sum = 0
count = 0
for i in range(1, 10000):
	count += 1
	num = num + i
	sum = sum + num
	if sum > n:
		print(count - 1)
		break
	elif sum == n:
		print(count)
		break


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


line = input()
n = int(line)
i = 1
s = 0
o = 0

def cumsum(n):
	s = 0
	for i in range(n + 1):
		s = s + i
	return s
while s + cumsum(i) <= n:
	s = s + cumsum(i)
	i = i + 1
	o = o + 1
print(o)


a = int(input())
i = 1
c = 0
while a > 0:
	a -= i * (i + 1) / 2
	c += 1
	i += 1
if a == 0:
	print(c)
else:
	print(c - 1)


n = int(input())
h = 0
i = 1
a = []
y = 1
while len(a) != n:
	a.append(i)
	i += 1
while n >= sum(a[0:y]):
	n -= sum(a[0:y])
	y += 1
	h += 1
print(h)


n = int(input())
l = 0
s = 1
a = 2
while s <= n:
	n -= s
	s += a
	a += 1
	l += 1
print(l)


n = int(input())
sum = 0
height = 0
temp = 0
for _ in range(1, 100000):
	if temp >= n:
		if temp > n:
			height -= 1
		break
	sum = sum + _
	temp = temp + sum
	height = height + 1
print(height)


n = int(input().strip())
i = 0
count = 0
j = 1
counter = 0
while True:
	i += j
	j += 1
	counter += i
	if not counter <= n:
		break
	count += 1
print(count)


n = int(input())
sum = 0
i = 0
q = 0
while q <= n:
	i += 1
	sum += i
	q += sum
print(i - 1)


n = int(input())
c = 0
(i, k) = (1, 1)
while n > 0:
	n = n - i
	c = c + 1
	k = k + 1
	i = i + k
if n == 0:
	print(c)
else:
	print(c - 1)


n = int(input())
i = 1
u = 1
h = 0
while i <= n:
	if n - u < 0:
		break
	n -= u
	h += 1
	i += 1
	u += i
print(h)


s = int(input())
k = 1
n = k * (k + 1) * (k + 2) // 6
while s >= n:
	n *= (k + 3) / k
	k += 1
print(k - 1)


def solve(n):
	sumnum = 0
	count = 1
	k = 0
	while sumnum <= n:
		k += count
		sumnum += k
		count += 1
	return count - 2
n = int(input())
print(solve(n))


n = int(input())
level = 1
inc = 2
total = 1
aux = 1
while total <= n:
	level += 1
	aux += inc
	total += aux
	inc += 1
print(str(level - 1))


import sys
n = int(input())
row = 0
sum_by_level = 0
answer = 0
while n > 0:
	row += 1
	sum_by_level += row
	if n >= sum_by_level:
		answer += 1
	n = n - sum_by_level
print(answer)


n = int(input())
rows = 0
cubes = 0
total = []
while sum(total) <= n:
	rows += 1
	cubes += rows
	total.append(cubes)
print(rows - 1)


cubes = int(input())
level = 0
total = 1
while cubes >= total:
	cubes -= total
	level += 1
	total += level + 1
print(level)


__author__ = 'valeriy.shevchuk'
n = int(input())
level = 1
prev = 1
sum = 1
while sum <= n:
	level += 1
	prev += level
	sum += prev
print(level - 1)


a = int(input())
i = 1
sum_row = 0
total_sum = 0
while total_sum < a:
	sum_row += i
	total_sum += sum_row
	if total_sum <= a:
		i += 1
print(i - 1)


n = int(input())
x = 1
t = 0
res = 0
for i in range(1, 201):
	t += x
	x += i + 1
	if n >= t:
		res = max(res, i)
print(res)


n = int(input())
s = 0
u = 0
while s < n:
	u += 1
	s += (u + 1) / 2 * u
print(u - (1 if s > n else 0))


est = int(input())
etag = 0
kubikov = 0
while est >= kubikov + etag + 1:
	etag = etag + 1
	kubikov = kubikov + etag
	est = est - kubikov
print(etag)


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


a = int(input())
ct = 0
d = 1
sum = 0
while True:
	sum += d
	if a < sum:
		break
	else:
		d += 1
		ct += 1
		a -= sum
print(ct)


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


from math import sqrt
n = int(input())
sum = i = 1
level = 0
while n > 0:
	n -= sum
	i += 1
	sum += i
	level += 1
print(level if n == 0 else level - 1)


a = int(input())
n = 1
while True:
	yo = n * (n + 1) * (n + 2) / 6
	if yo >= a:
		break
	n += 1
if yo == a:
	print(n)
else:
	print(n - 1)


n = int(input())
k = 0
i = 0

def sum(i):
	return i * (i + 1) / 2
while k <= n:
	i = i + 1
	k = k + sum(i)
print(i - 1)


n = int(input())
h = 0
flr = 0
while True:
	h += 1
	flr += h * (h + 1) / 2
	if flr > n:
		break
print(h - 1)


n = int(input())
l = []
for i in range(0, 10000):
	l.append(i * (i + 1) // 2)
for i in range(1, len(l)):
	l[i] = l[i] + l[i - 1]
I = 0
J = len(l) - 1
V = -1
while I <= J:
	m = (I + J) // 2
	if l[m] == n:
		V = m
		break
	elif l[m] > n:
		J = m - 1
	else:
		V = m
		I = m + 1
print(V)


def main():
	from sys import stdin, stdout
	n = int(stdin.readline())
	s = 0
	i = 0
	while s <= n:
		s += (i + 2) * (i + 1) // 2
		i += 1
	stdout.write(str(i - 1))
main()


n = int(input())
Sum = 0
i = 0
while Sum <= n:
	i += 1
	temp = 0
	for x in range(i + 1):
		temp += x
	Sum += temp
print(i - 1)


n = int(input())
i = 1
sum1 = 0
layer = 0
cubes = 0
while cubes < n:
	sum1 += i
	cubes += sum1
	layer += 1
	i += 1
if cubes > n:
	layer -= 1
print(layer)


n = int(input())
sum = 1
layer = 1
count = 1
while sum < n:
	count += 1
	layer += count
	sum += layer
else:
	if sum == n:
		print(count)
	else:
		print(count - 1)


n = int(input())
count = 0
cube = 0
for x in range(1, n + 1):
	cube += x
	if n < cube or n == 0:
		break
	else:
		count += 1
		n -= cube
print(count)


n = int(input())
r = 1
kk = 0
s = 0
while s < n:
	kk = kk + r
	s = s + kk
	if r + 1 + kk + s <= n:
		r = r + 1
print(r)


cubes = int(input())
levels = 0
needed = 1
while cubes >= needed:
	levels += 1
	cubes -= needed
	needed += levels + 1
print(levels)


import sys
number = int(sys.stdin.readline().strip())
floors = blocksPerFloor = totalBlocks = 1
while number >= totalBlocks:
	floors += 1
	blocksPerFloor += floors
	totalBlocks += blocksPerFloor
	if number < totalBlocks:
		floors -= 1
print(floors)


cubes = int(input())
h = 0
while cubes >= 0:
	h += 1
	cubes -= h * (h + 1) // 2
print(h - 1)


x = int(input())
level = 0
level_k = 0
s = 0
while s < x:
	level += 1
	level_k = level_k + level
	s = s + level_k
if s == x:
	print(level)
else:
	print(level - 1)


n = int(input())
(sum, res) = (0, 0)
(level, num) = (1, 1)
while sum + level <= n:
	res += 1
	sum += level
	num += 1
	level += num
print(res)


x = int(input())
s = 0
while x >= s * (s + 1) * (s / 6 + 1 / 3):
	s = s + 1
print(s - 1)


num = input()
num = int(num)
if num > 0 and num < 10001:
	ctrht = 0
	total = 0
	while True:
		ctrht += 1
		ctr = 0
		while ctrht >= ctr:
			total += ctr
			ctr += 1
		if total > num:
			break
	print(ctrht - 1)
else:
	print('Invalid input')


n = int(input())
res = 0
while res * (res + 1) * (res + 2) // 6 <= n:
	res = res + 1
print(res - 1)


n = eval(input())
i = 1
while n > 0:
	bricks = i * (i + 1) // 2
	if n >= bricks:
		n -= bricks
		i += 1
	else:
		break
print(i - 1)


n = int(input())
i = 0
count = 0
cubes = 0
while n - (cubes + count + 1) >= 0:
	count += 1
	cubes = cubes + count
	n = n - cubes
	i += 1
print(i)


num_blocks = int(input())
level = 1
blocks_needed = 1
while blocks_needed <= num_blocks:
	num_blocks -= blocks_needed
	level += 1
	blocks_needed += level
print(level - 1)


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


n = int(input())
i = 0
while True:
	n -= (1 + i) * i // 2
	if n < 0:
		print(i - 1)
		exit()
	i += 1


x = int(input())
l = []
sum = 0
sum_count = 0
for i in range(1, 10001):
	l.insert(i, sum + i)
	sum += i
for i in range(1, 10001):
	sum_count += l[i]
	if x <= sum_count:
		print(i)
		exit()


blocks = int(input())
level = 1
sumbl = 1
while blocks >= sumbl:
	blocks = blocks - sumbl
	level = level + 1
	sumbl = sumbl + level
print(level - 1)


def search(li, key):
	(i, j) = (0, len(li) - 1)
	pos = -1
	while i <= j:
		mid = (i + j) // 2
		if li[mid] <= key:
			pos = mid
			i = mid + 1
		else:
			j = mid - 1
	return pos + 1
n = int(input())
i = 1
li = []
x = 0
while x <= 10 ** 4:
	x += i * (i + 1) // 2
	li.append(x)
	i += 1
print(search(li, n))


n = int(input())
count = 1
solan = 0
d = 1
for i in range(2, 100000):
	count += i
	d += count
	solan += 1
	if d > n:
		break
print(solan)


t = int(input())
c = 0
x = 0
p = 0
for i in range(1, 10 ** 4):
	k = c + i
	p += k
	c = k
	x += 1
	if p >= t:
		break
if t == 1 or t == p:
	print(x)
else:
	print(x - 1)


n = int(input())
(counter, x, sm) = (1, 1, 1)
while sm <= n:
	counter += 1
	x += counter
	sm += x
print(counter - 1)


numberOfCubes = int(input())
sum = 0
cubesOfRow = 0
level = 1
while level < int(numberOfCubes / 2) and sum <= numberOfCubes:
	cubesOfRow = cubesOfRow + level
	sum = sum + cubesOfRow
	if sum + cubesOfRow + level + 1 <= numberOfCubes:
		level = level + 1
print(level)


n = int(input())
L = 0
while n >= 0:
	nb = (L + 1) * (L + 2) / 2
	if n >= nb:
		L += 1
	n -= nb
print(L)


n = int(input())
q = r = 1
w = 0
while q <= n:
	w += 1
	r += w + 1
	q += r
print(w)


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


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


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


n = int(input())
sum = result = 0
for i in range(1, 300):
	sum += i
	result += sum
	if result > n:
		print(i - 1)
		exit()


n = int(input())
cal = n * 6
flag = True
i = 1
while flag:
	res = i * (i + 1) * (i + 2)
	if res <= cal:
		i = i + 1
	else:
		flag = False
print(i - 1)


n = int(input())
a = b = c = 0
while n > b:
	a += 1
	t = c + a
	b += t
	c = t
	if n < b:
		a -= 1
print(a)


m = int(input())
x = 1
while True:
	a = 1 / 6 * x ** 3 + 1 / 2 * x ** 2 + 1 / 3 * x
	if a - int(a) > 0.5:
		b = int(a) + 1
	else:
		b = int(a)
	if b > m:
		break
	x += 1
print(x - 1)


q = int(input())
l = 1
s = 1
v = 1
while True:
	if q == v:
		print(l)
		break
	if q < v:
		print(l - 1)
		break
	l += 1
	s += l
	v += s


n = int(input())
i = 0
h = 1
while n - h >= 0:
	n -= h
	i += 1
	h += 1 + i
print(i)


n = int(input())
a = 0
l = 0
for i in range(5000):
	l += i
	a += l
	if a > n:
		break
print(i - 1)


__author__ = 'Rakshak.R.Hegde'
n = int(input())
used = t = q = level = 0
while used <= n:
	level += 1
	q += 1
	t += q
	used += t
print(level - 1)


def solve():
	n = int(input())
	h = 0
	s = 0
	while s + (h + 1) * (h + 2) // 2 <= n:
		s += (h + 1) * (h + 2) // 2
		h += 1
	print(h)
solve()


a = int(input())
print(int((3 * a + (9 * a * a - 1 / 27) ** 0.5) ** (1 / 3) + (3 * a - (9 * a * a - 1 / 27) ** 0.5) ** (1 / 3) - 0.99999999))


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)


a = int(input())
s = 0
i = 1
n = 0
e = 0
while s < a:
	n += 1
	e += i
	s += e
	i += 1
if s == a:
	print(n)
else:
	print(n - 1)


n = int(input())
arr = []
sum = 0
for i in range(1, 500):
	sum += i
	arr.append(sum)
for i in range(1, len(arr)):
	arr[i] = arr[i - 1] + arr[i]
cnt = 0
j = 0
while arr[j] <= n:
	j += 1
	cnt += 1
print(cnt)


(c, h) = (1, 1)
n = int(input())
while n >= c:
	n -= c
	h += 1
	c += h
print(h - 1)


n = int(input())
level = 0
current = 0
total = 0
while total <= n:
	level += 1
	current += level
	total += current
print(level - 1)


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


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


n = int(input())
c = 0
while c * (c + 1) * (c + 2) // 6 <= n:
	c += 1
print(c - 1)


__author__ = 'DuB'

def level(x):
	a = 0
	for i in range(1, x + 1):
		a += i
	return a
n = int(input())
a = 0
k = 0
while a <= n:
	k += 1
	a = a + level(k)
print(k - 1)


a = int(input())
n = 1
y = 0
while a >= 0:
	a = a - n
	y = y + 1
	n = n + 1 + y
print(y - 1)


def func(n):
	return 2 * n * (n + 1) * (n + 2) // 12
t = int(input())
n = 1
while func(n) <= t:
	n += 1
print(n - 1)


n = int(input())
cubesleft = n - 1
floors = 1
if n <= 3:
	print(1)
else:
	for i in range(n):
		floors += 1
		sum = floors * (floors + 1) / 2
		cubesleft -= sum
		if sum > cubesleft + sum:
			floors -= 1
			print(floors)
			break


cubes = int(input())
cubesneed = 1
height = 1
while True:
	cubes -= cubesneed
	if cubes < 0:
		break
	height += 1
	cubesneed += height
print(height - 1)


n = int(input())
h = 1
while h * (h + 1) * (h + 2) <= 6 * n:
	h += 1
print(h - 1)


nl = 1
i = 1
totals = [1]
while totals[-1] < 10000:
	i += 1
	nl += i
	totals.append(totals[-1] + nl)
n = int(input())
for (i, v) in enumerate(totals):
	if v > n:
		print(i)
		break


n = int(input())
c = 0
cc = 1
p = 0
h = 0
while c + p + cc <= n:
	c += p + cc
	p += cc
	cc += 1
	h += 1
print(h)


n = int(input())
ni = 0
remain = n
count = 0
if 1 <= n <= 10 ** 4:
	for i in range(1, n + 1):
		ni += i
		if remain >= ni and remain > 0:
			remain -= ni
			count += 1
print(count)


num = int(input())
l = list()
l.append(0)
res = 0
if num <= 2:
	print('1')
	exit()
for i in range(1, num + 1):
	l.append(l[i - 1] + i)
	res += l[i]
	if res > num:
		print(i - 1)
		exit()


n = int(input())
layer = 1
while 2 > 0:
	total = 0
	for j in range(1, layer + 1):
		total = total + j
	n = n - total
	if n < 0:
		break
	layer += 1
print(layer - 1)


n = int(input())
ans = 0
s = 0
x = []
if n == 1 or n == 2:
	ans = 1
else:
	for i in range(1, n + 1):
		s += i
		x.append(s)
		if sum(x) <= n:
			ans += 1
		else:
			break
print(ans)


import bisect
s1 = [1]
s2 = [1]
for i in range(2, 10001):
	s1.append(i + s1[i - 2])
for i in range(1, len(s1)):
	s2.append(s1[i] + s2[i - 1])
print(bisect.bisect_right(s2, int(input())))


c = 0
n = int(input())
(i, c) = (1, 0)
run = True
while run:
	n -= i * (i + 1) // 2
	if n < 0:
		run = False
	else:
		c += 1
		i += 1
print(c)


n = int(input())
t = 1
s = 1
c = 2
cnt = 0
while t <= n:
	s += c
	t += s
	c += 1
	cnt += 1
print(cnt)


from math import floor, ceil, log

def main():
	n = int(input())
	total = 0
	i = 0
	while total <= n:
		i += 1
		total += i * (i + 1) // 2
	print(i - 1)
main()


n = int(input())
num = 0
num2 = 0
count = 2
while True:
	for i in range(count):
		num += i
	num2 += num
	if num2 > n:
		print(count - 2)
		break
	if num2 == n:
		print(count - 1)
		break
	num = 0
	count += 1


a = int(input())
i = 1
j = 0
x = 0
d = 0
while i <= a:
	j = j + i
	x = x + j
	if x > a:
		break
	d = d + 1
	i = i + 1
print(d)


n = int(input().strip('\n\r\t '))
s = 0
h = 1
while True:
	s += (h + 1) * h // 2
	if s <= n:
		h += 1
	else:
		break
if s < n:
	print(h - 2)
else:
	print(h - 1)


n = int(input())
l = 0
n1 = 0
while n > 0:
	l = l + 1
	n1 = n1 + l
	n = n - n1
	if n < 0:
		l = l - 1
print(l)


n = int(input())
x = 0
y = 0
h = 0
while n > 0:
	y += 1
	x = x + y
	n = n - x
	if n < 0:
		break
	h += 1
print(h)


n = int(input())
sum = 0
for i in range(1, 100000000):
	sum += i
	if n - sum < 0:
		print(i - 1)
		break
	else:
		n -= sum


def suma(n):
	s = n * (n + 1) // 2
	return s
n = int(input())
k = 1
c = 0
acu = 0
while k <= n:
	x = suma(k)
	acu += x
	if acu <= n:
		c += 1
	k += 1
x = c
print(x)


a = int(input())
k = 1
n = 1
while k < a:
	n += 1
	k = n * (n + 1) * (n + 2) / 6
if k == a:
	print(n)
else:
	print(n - 1)


n = int(input())
m = n
cnt = 0
c = 0
for i in range(1, n):
	c += i
	if n - c >= 0:
		cnt += 1
		n -= c
if m == 1:
	print(1)
else:
	print(cnt)


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


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


from sys import stdin, stdout
from bisect import *
n = int(stdin.readline())
cube = [0]
for i in range(1, 40):
	cube.append(cube[i - 1] + i * (i + 1) // 2)
stdout.write('%d' % (lambda x: x if cube[x] == n else x - 1)(bisect(cube, n, 1, 39)))


import sys
n = int(input())
s = 0
i = 1
while s < n:
	term = 1 + (i - 1)
	s += (1 + term) * i / 2
	if s > n:
		break
	i += 1
print(i - 1)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
amount = int(f_input())
mini_dp = [0 for i in range(amount + 2)]
max_ = 0
for i in range(1, amount + 2):
	mini_dp[i] = mini_dp[i - 1] + i
	if amount - mini_dp[i] < 0:
		f_print(str(max_))
		break
	amount -= mini_dp[i]
	max_ += 1


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


a = int(input())
c = 0
i = 0
e = 0
while c <= a:
	e += 1
	i += e
	c += i
print(e - 1)


n = int(input())
lvl = 0
row = 1
plus = 2
while n >= 0:
	n -= row
	lvl += 1
	row += plus
	plus += 1
print(lvl - 1)


def compute(n):
	return n * (n + 1) * (n + 2)
n = int(input())
res = int(pow(6 * n, 1 / 3))
while compute(res) > 6 * n:
	res -= 1
print(res)


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


n = int(input())
res = 0
tmp = 0
if n != 1:
	for i in range(1, n):
		tmp += i
		if n - tmp >= 0:
			n = n - tmp
			res += 1
else:
	res = 1
print(res)


import sys
numb = int(sys.stdin.readline().rstrip())
count_general = 0
count_natural_numb = 1
count_triangular_numb = 0
sum_triangular_numb = 0
while count_triangular_numb <= numb:
	count_triangular_numb += count_natural_numb
	count_natural_numb += 1
	sum_triangular_numb += count_triangular_numb
	if sum_triangular_numb > numb:
		break
	count_general += 1
sys.stdout.write(f'{count_general}')


n = int(input())
ans = 0
y = 0
i = 1
while True:
	r = i * (i + 1) // 2
	ans += r
	y += 1
	i += 1
	if ans > n:
		print(y - 1)
		break
	if ans == n:
		print(y)
		break


n = int(input())
x = 0
count = 0
while n >= x + count + 1:
	count += 1
	x = x + count
	n -= x
print(count)


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


n = int(input())
z = [1]
s = 1
for i in range(2, n):
	s = s + i
	z.append(s)
	if sum(z) > n:
		break
if len(z) > 1:
	print(len(z) - 1)
else:
	print(len(z))


def sum1(n):
	s = 0
	for i in range(1, n + 1):
		s += i
	return s
n = int(input())
t = 1
l = 0
while True:
	if l < n:
		t += 1
		l += sum1(t)
	else:
		print(t - 1)
		break


def main():
	s = [0, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, 1140, 1330, 1540, 1771, 2024, 2300, 2600, 2925, 3276, 3654, 4060, 4495, 4960, 5456, 5984, 6545, 7140, 7770, 8436, 9139, 9880, 10660]
	n = int(input())
	result = next((i for i in range(len(s) - 1) if s[i + 1] > n))
	print(result)
main()


n = int(input())
(s, p, r, o) = (0, 0, 0, 1)
while True:
	r = r + o
	p += r
	if p <= n:
		s += 1
		o += 1
	else:
		break
print(s)


n = int(input())
if n < 0 or n > 10000:
	print('eror')
count = 0
kolkv = 0
while n > 0:
	count += 1
	i = count
	while i > 0:
		n -= i
		i -= 1
	if n < 0:
		count -= 1
print(count)


l = []
for i in range(1, 40):
	l.append(i * (i + 2) * (i + 1) // 6)
n = int(input())
s = []
for i in range(1, len(l)):
	if l[i - 1] <= n <= l[i]:
		s.append(i)
print(max(s))


n = int(input())
if n == 1:
	print(1)
else:
	a = 0
	sm = 0
	for i in range(1, n + 1):
		if sm + i + a > n:
			break
		a += i
		sm += a
	print(i - 1)


n = int(input())
c = 0
ans = 0
k = 1
count = 0
while ans < n:
	c += k
	ans += c
	k += 1
	count += 1
if ans == n:
	print(count)
else:
	print(count - 1)


n = int(input())

def m(x):
	m = 0
	for i in range(1, x + 1):
		m += i * (1 + i) / 2
	return m
x = 1
while m(x) <= n:
	x += 1
print(x - 1)


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


a = int(input())
i = 1
p = 0
c = 0
if a == 1:
	print('1')
else:
	while a - i >= 0:
		i = i + 1
		p = p + i
		a = a - p
		c = c + 1
	print(c)


import sys
n = int(input())
s = 0
for x in range(1, 1000):
	s += x
	n -= s
	if n < 0:
		print(x - 1)
		sys.exit()


n = int(input())
h = 0
count = 1
while True:
	sum = count * (count + 1) // 2
	if sum <= n:
		n -= sum
		h += 1
	else:
		break
	count += 1
print(h)


n = int(input())
ans = 0
pd = 1
while 1:
	for i in range(1, pd + 1):
		n -= i
	if n < 0:
		break
	else:
		ans += 1
	pd += 1
print(ans)


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


c = int(input())
b = 0
cnt = 0
while b < c:
	b += sum(range(1, cnt + 2))
	if b > c:
		break
	cnt += 1
print(cnt)


import math
import sys
from sys import *
from bisect import insort
import heapq
import collections
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, combinations_with_replacement
import random
import os
mod = 10 ** 9 + 7
MAX = sys.maxsize
MIN = -sys.maxsize - 1

def isPrime(n):
	if n > 1:
		for i in range(2, n):
			if n % i == 0:
				return False
		else:
			return True
	else:
		return False

def isPanagram(s):
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	for char in alphabet:
		if char not in s.lower():
			return False
	return True

def isEqual(list1):
	if len(list1) < 0:
		res = True
	res = all((ele == list1[0] for ele in list1))
	if res:
		return True
	else:
		return False

def remove_duplicate(list1):
	final_list = []
	for i in list1:
		if i not in final_list:
			final_list.append(i)
	return final_list % mod

def solve():
	n = int(input())
	(i, current, last) = (0, 0, 0)
	while n > 0:
		i += 1
		current = last + i
		last = current
		n -= current
		if n < 0:
			i -= 1
	return i
result = solve()
stdout.write(str(result) + '\n')


n = int(input())
t = 0
num = 0
while num <= n:
	t = t + 1
	num = num + t * (t + 1) / 2
print(t - 1)


n = int(input())
mark = [0, 1, 3, 6]

def cal(n, arr):
	if n < len(arr):
		return arr[n]
	arr.append(arr[len(arr) - 1] + len(arr))
	return cal(n, arr)
i = 0
while n - mark[i] >= 0:
	n -= mark[i]
	i += 1
	cal(i, mark)
print(i - 1)


n = int(input())
k = 1
r = 1
while r <= n:
	k += 1
	r += k * (k + 1) // 2
print(k - 1)


n = int(input())
w = 0
m = 0
s = 0
if n == 1:
	print(1 // n)
else:
	for i in range(1, n + 1):
		if m > n:
			break
		else:
			s += i
			w += 1
			m += s
	print(w - 1)


n = int(input())
(prod, i, count) = (0, 1, 0)
for i in range(1, n + 1):
	prod += i * (i + 1) / 2
	if prod <= n:
		count += 1
	else:
		break
print(count)


a = []
b = []
count = 0
for i in range(1, 10001):
	a.append(i * (i + 1) // 2)
for elem in a:
	count += elem
	b.append(count)
n = int(input())
if n in b:
	print(b.index(n) + 1)
else:
	b.append(n)
	b.sort()
	print(b.index(n))


sumacion = lambda x: int(x * (x + 1) / 2)
n = int(input())
cnt = 0
i = 1
while n >= 0:
	n = n - sumacion(i)
	i = i + 1
	cnt = cnt + 1
print(cnt - 1)


n = int(input())
sum_ = 0
height = 1
while sum_ >= 0:
	for i in range(1, height + 1):
		sum_ += i
	if sum_ == n:
		print(height)
		break
	if sum_ > n:
		print(height - 1)
		break
	height += 1


n = int(input())
h = 0
i = 1
while i * (i + 1) * (i + 2) / 6 <= n:
	h += 1
	i += 1
print(h)


n = int(input())
r = 0
cubes = 0
while n > 0:
	r += 1
	cubes += r
	n -= cubes
	if n < cubes + r + 1:
		break
print(r)


n = int(input())
total = row = 1
while n > 0:
	row += 1
	total += row
	n -= total
print(row - 1)


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())
i = 1
sum = 1
count = 0
while n >= sum:
	n = n - sum
	count = count + 1
	i = i + 1
	sum = sum + i
print(count)


N = int(input())
SUM = 0
for i in range(1, N + 1):
	SUM += sum(range(1, i + 1))
	if SUM == N:
		print(i)
		exit()
	elif SUM > N:
		print(i - 1)
		exit()


n = int(input())
height = 0
prevLen = 0
total = 0
while n >= total:
	height += 1
	prevLen += height
	total += prevLen
print(height - 1)


N = int(input())
Contador = 0
if N == 1:
	print('1')
else:
	Cubos = 0
	A = N
	for k in range(1, N + 1):
		Cubos += k
		if Cubos > A:
			break
		else:
			A -= Cubos
			Contador += 1
	print(Contador)


a = int(input())
sum = 0
count = 0
for i in range(1, 10001):
	sum_temp = 0
	for m in range(1, i + 1):
		sum_temp += m
	sum += sum_temp
	if sum <= a:
		count += 1
	else:
		break
print(count)


import math
a = [0, 1, 4]
for i in range(3, 10 ** 6):
	b = i * (i + 1) // 2
	a.append(a[-1] + b)
n = int(input())
for i in range(10 ** 6):
	if a[i] > n:
		print(i - 1)
		break


import sys

def main():
	cubes = int(sys.stdin.readline().strip())
	level = 1
	while cubes >= level * (level + 1) / 2:
		cubes -= level * (level + 1) / 2
		level += 1
	print(level - 1)
main()


a = int(input())
i = 0
b = 0
c = 0
while c < a:
	i = i + 1
	b = b + i
	c = c + b
	if c > a:
		i = i - 1
	if c == a:
		break
print(i)


x = int(input())
p = 0
d = 0
j = 0
for i in range(1, x + 2):
	p = p + i
	if d + p <= x:
		d += p
		j += 1
	else:
		print(j)
		break


a = int(input(''))
n = 1
product = 0
while product <= a:
	product = (n + 2) * (n + 3) * (n + 1) / 6
	n = n + 1
print(n - 1)


import sys
cubes = int(input())
temp = 0
templist = []
for i in range(10000):
	if i == 0:
		templist.append(i)
	else:
		templist.append(i + templist[i - 1])
		temp = sum(templist)
		if cubes == temp:
			print(len(templist) - 1)
			sys.exit(0)
		elif cubes < temp:
			print(len(templist) - 2)
			sys.exit(0)
		else:
			continue


n = int(input())
count = 0
my_list = []
new_list = []
for i in range(1, n + 1):
	my_list.append(i)
	new_list.append(sum(my_list))
	if sum(new_list) <= n:
		count += 1
	else:
		break
print(count)


def sum(a):
	b = 0
	for i in range(a + 1):
		b = b + i
	return b
n = int(input())
sum1 = 0
h = 0
i = 1
while sum1 <= n:
	sum1 = sum1 + sum(i)
	i += 1
	if sum1 <= n:
		h += 1
print(h)


i = int(input())
summ = []
sch = 1
suka = []
while sum(suka) <= i:
	summ.append(sch)
	sch += 1
	suka.append(sum(summ))
suka.pop()
print(len(suka))


n = k = 1
c = int(input())
while c >= k:
	n += 1
	k = n * (n + 1) * (n + 2) // 6
print(n - 1)


n = int(input())
(l, l2) = ([], [])
if n == 1:
	print(1)
for i in range(n + 1):
	s = i * (i + 1) / 2
	l.append(s)
g = 0
for i in range(len(l)):
	v = g + l[i]
	g = v
	l2.append(v)
for i in range(len(l2) - 1):
	if l2[i] <= n and l2[i + 1] > n:
		print(i)


a = int(input())
c = 1
for x in range(1, 10000):
	a -= c
	if a < 0:
		print(x - 1)
		break
	c += x + 1
	x += 1


from sys import stdin, stdout, stderr, setrecursionlimit
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	import inspect, re
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readia(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writea(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
n = readint()
lvl = 1
t = 1
while t <= n:
	dd(t, n, lvl)
	lvl += 1
	n -= t
	t = lvl * (lvl + 1) // 2
write(lvl - 1)


num_cubes = int(input())
total = 0
temp = 0
count = 0
for i in range(0, 10000):
	total += i
	temp += total
	if temp > num_cubes:
		break
	count = i
print(count)


n = int(input())
base = 1
fila = 1
cubos = 1
while n >= cubos:
	fila = fila + 1
	base = base + fila
	cubos = cubos + base
print(fila - 1)


def sum(n):
	return int(n * (n + 1) / 2)
inp = int(input())
h = 1
total = 0
while total < inp:
	h += 1
	total += sum(h)
print(h - 1)


n = int(input())
(row, cubes_in_row) = (0, 0)
while n >= cubes_in_row + row + 1:
	row += 1
	cubes_in_row += row
	n -= cubes_in_row
print(row)


n = int(input())
x = n - 1
count = 1
y = 1
i = 2
if n == 1:
	print('1')
else:
	while True:
		if x < y:
			break
		y = y + i
		x = x - y
		i = i + 1
		if x >= 0:
			count = count + 1
	print(count)


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


def reverse_fact(n):
	i = 1
	while n > 0:
		for inx in range(i + 1):
			sub = n - inx
			n = sub
		if n < 0:
			return i - 1
		elif n == 0:
			return i
		if n <= 0:
			break
		i = i + 1
x = int(input())
print(reverse_fact(x))


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
i = 1
while True:
	n -= int(i * (i + 1) / 2)
	if n == 0:
		print(i)
		break
	if n < 0:
		print(i - 1)
		break
	i += 1


n = int(input())
i = 0
s = 0
m = []
m.append(0)
while s <= n:
	i += 1
	m.append(m[i - 1] + i)
	s += m[i]
i -= 1
print(i)


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


n = int(input())
tower = 0
d = 1
p = 2
while n >= d:
	tower += 1
	n -= d
	d += p
	p += 1
print(tower)


n = int(input())
h = 0
l = 0
c = 0
while n > 0:
	h = h + 1
	c = l + h
	l = c
	n = n - c
	if n < 0:
		h = h - 1
print(h)


n = int(input())
_count = 0
_flo = 0
_sum = 0
while _count < n:
	_flo += 1
	_count += _flo
	n -= _count
if n < 0:
	_flo -= 1
print(_flo)


s = int(input())
for a in range(1, 100000):
	if s < a * (a + 1) * (a + 2) / 6:
		print(a - 1)
		break


a = int(input())
b = 0
for i in range(1, 10000):
	if a >= 0:
		b += 1
		for j in range(1, i + 1):
			a -= j
	else:
		b -= 1
		break
print(b)


n = int(input())
x = 1
h = 1
while x <= n:
	h += 1
	next_level = h * (h + 1) // 2
	x += next_level
if x > n:
	h -= 1
print(h)


n = int(input())
i = 1
sum_coub = 1
n -= 1
while n > 0:
	i += 1
	sum_coub += i
	n -= sum_coub
if n < 0:
	i -= 1
print(i)


n = int(input())
cubes = 0
row = 0
while cubes <= n:
	row += 1
	cubes += row * (row + 1) / 2
print(row - 1)


n = int(input())
b = 0
for i in range(0, n + 1, 1):
	c = i * (i + 1) / 2
	b = b + c
	d = n - b - (i + 1) * (i + 2) / 2
	if d < 0:
		break
print(i)


f = lambda x: int(x * (x + 1) * (x + 2) / 6)
b = int(input())
a = int((6 * b) ** (1 / 3))
print([a - 1, a][f(a) <= b])


n = int(input())
i = 0
total = 0
s = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780]
while i < 40:
	total += s[i]
	if total > n:
		print(i)
		break
	i += 1


n = int(input())
cubes = 1
level = 1
count = 0
while n >= cubes:
	n = n - cubes
	level = level + 1
	cubes = cubes + level
	count = count + 1
print(count)


a = int(input())
h = 1
n = 1
symma = 1
while symma <= a:
	h = h + 1
	n = n + h
	symma = symma + n
print(h - 1)


def pyramid(i, last_size, cubes_left):
	if cubes_left < 0:
		return i - 1
	i += 1
	return pyramid(i, last_size + i, cubes_left - last_size - i)
n = int(input())
print(pyramid(1, 1, n - 1))


n = int(input())
n1 = 1
while n1 * n1 * n1 - n1 <= 6 * n:
	n1 += 1
print(n1 - 2)


n = int(input())
x = 0
y = 0
for i in range(10 ** 9):
	x = x + i + 1
	y = y + x
	if n < y:
		print(i)
		break


a = int(input())
height = 0
count = 1
row = 1
while row <= a:
	height += 1
	row += count
	count += 1
	a -= row
print(height)


cubes = int(input())
a = [0]
while cubes > 0:
	a.append(len(a) + a[-1])
	cubes -= len(a) + a[-1]
print(len(a) - 1)


c = 1
b = 2
d = 1
h = 0
n = int(input())
while c <= n:
	h += 1
	d += b
	c += d
	b += 1
print(h)


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


i = int(input())
count = 0
k = 0
sum = 0
while sum + count + k + 1 <= i:
	k = k + 1
	count = count + k
	sum = sum + count
print(k)


def numsum(n):
	count = 0
	while n > 0:
		count += n
		n -= 1
	return count

def cumsum(n):
	res = 0
	for i in range(1, n + 1):
		res += numsum(i)
	return res
n = int(input())
count = 0
i = 1
while 1:
	if cumsum(i) > n:
		break
	x = cumsum(i)
	i += 1
print(i - 1)


x = int(input())
i = 0
k = 0
l = 0
while l <= x:
	i += 1
	k += i
	l += k
print(i - 1)


numb = int(input())
level = 0
cub_level = 0
summed = 0
while summed < numb:
	level += 1
	cub_level += level
	summed += cub_level
if numb < summed:
	level -= 1
print(level)


n = int(input())
h = 0
cur = 1
ind = 1
while n > 0 and cur <= n:
	n -= cur
	ind += 1
	cur += ind
	h += 1
print(h)


n = int(input())
s = 0
x = 0
m = 0
for i in range(1, n + 1):
	s += i
	x += 1
	m += s
	if m > n:
		x -= 1
		break
print(x)


n = int(input())
i = 1
floor = 1
needConcrete = 1
while needConcrete <= n:
	floor = i
	i += 1
	needConcrete += i * (i + 1) / 2
print(floor)


n = int(input())
i = 0
s = 0
a = []
while i <= n:
	a.append(i)
	s = s + sum(a)
	if s > n:
		print(i - 1)
		break
	elif s == n:
		print(i)
		break
	i = i + 1


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


n = int(input().strip())
ans = 0
level = 1
while True:
	if level * (level + 1) // 2 <= n:
		ans += 1
		n -= level * (level + 1) // 2
		level += 1
	else:
		break
print(ans)


k = int(input())
i = 1
for i in range(1, k):
	p = i * (i + 1) * (i + 2) // 6
	if p > k:
		i = i - 1
		break
print(i)


cubics = int(input())
i = 1
n = 0
while n <= cubics:
	n += i * (i + 1) // 2
	i += 1
if cubics == 1:
	print(1)
else:
	print(i - 2)


n = int(input())
cnt = 0
l1 = 1
l2 = 2
while n > 0:
	n = n - l1
	l1 = l1 + l2
	l2 += 1
	cnt += 1
if n == 0:
	print(cnt)
else:
	print(cnt - 1)


n = int(input())
q = 0
a = 0
m = 0
s = 0
while True:
	q += 1
	a += q
	s += a
	if n < s:
		print(m)
		break
	m += 1


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


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


def main():
	n = int(input())
	cubes = 0
	usedCubes = 0
	height = 0
	lastCubes = 0
	while n > usedCubes:
		height += 1
		cubes = lastCubes + height
		usedCubes += cubes
		lastCubes = cubes
		if n < usedCubes:
			height -= 1
	print(height)
main()


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


n = int(input())
a = 0
sum = a * (a + 1) // 2
while True:
	sum = sum + a * (a + 1) // 2
	if sum >= n:
		print(max(1, a - (sum != n)))
		break
	a += 1


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


n = int(input())
m = 0
m += n
sum = 0
count = 0
if n == 1:
	print(1)
else:
	for i in range(1, m):
		sum += i
		if sum > n:
			break
		n = n - sum
		count += 1
	print(count)


n = int(input())
z = 1
c = 1
d = 0
while n >= z:
	n = n - z
	c = c + 1
	z = z + c
	d = d + 1
print(d)


n = int(input())
ans = 0
total = 0
max = 0
for i in range(1, n + 1):
	ans = ans + i
	total = total + ans
	max = max + 1
	if total > n:
		max = max - 1
		break
print(max)


(n, h, sum) = (int(input()), 1, 0)
while True:
	sum += h
	if n < sum:
		break
	n -= sum
	h += 1
print(h - 1)


N = int(input())
i = 1
k = 1
N -= 1
while True:
	k += 1
	i += k
	N -= i
	if N < 0:
		k -= 1
		break
print(k)


n = int(input())
i = 0
nomber = 0
while n >= 0:
	i += 1
	nomber += i
	n -= nomber
print(i - 1)


n = int(input())
sum = 0
d = 0
i = 1
while n > 0:
	sum = 0
	for x in range(1, i + 1):
		sum += x
	i += 1
	n = n - sum
if n < 0:
	i = i - 2
else:
	i = i - 1
print(i)


i = int(input())
x = 0
count = 0
y = 0
while y <= i:
	count += 1
	x = x + count
	y = y + x
print(count - 1)


n = int(input())
l = 1
s = 0
while True:
	lc = l * (l + 1) // 2
	if s + lc > n:
		print(l - 1)
		break
	l += 1
	s += lc


def get_need(l_need, l_level):
	l_need += l_level
	return l_need
n = int(input())
level = 1
need = 0
while True:
	need = get_need(need, level)
	if n - need >= 0:
		n -= need
		level += 1
	else:
		print(level - 1)
		exit()


def add(x):
	s = 0
	for k in range(1, x + 1):
		s += k
	return s
n = int(input())
i = 1
h = 0
while n > 0:
	if n - add(i) >= 0:
		n -= add(i)
		h += 1
		i += 1
	else:
		break
print(h)


n = int(input())
level = 1
needed = level * (level + 1) / 2
while n >= needed:
	n -= needed
	level += 1
	needed = level * (level + 1) / 2
print(level - 1)


n = int(input())
sum = 0
count = 0
s = set()
while sum < n:
	count += 1
	sum1 = 0
	for i in range(count):
		sum1 += i + 1
	sum += sum1
	s.add(sum)
if n in s:
	print(count)
else:
	print(count - 1)


x = int(input())
s = 1
i = 1
while x >= s:
	s += i
	x -= s
	i += 1
print(i - 1)


def pyramid(cubes):
	(count, i) = (0, 0)
	while count <= cubes:
		i += 1
		count += i * (i + 1) // 2
	return i - 1
print(pyramid(int(input())))


n = int(input())
cubes = 1
level = 1
currcubes = 1
while cubes <= n:
	level += 1
	currcubes += level
	cubes += currcubes
print(level - 1)


con = 0
con2 = 0
n = int(input())
i = 1
while i < 1000000:
	j = 1
	con = 0
	while j <= i:
		con += j
		j += 1
	if n - con >= 0:
		n -= con
		con2 += 1
	else:
		break
	i += 1
print(con2)


n = int(input())
sum = 0
count = 0
total = 0
if n == 1:
	print(n)
else:
	for i in range(1, 10000):
		sum = sum + i
		total = total + sum
		count = count + 1
		if total == n:
			print(count)
			break
		elif total > n:
			count = count - 1
			print(count)
			break


n = int(input())
a = 0
l = []
for i in range(1, n + 1):
	a = a + i
	n = n - a
	if a == 1:
		l.append(a)
		continue
	if n >= 0 and a > l[-1]:
		l.append(a)
	else:
		break
print(len(l))


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


def function1(n):
	(k, z, h) = [0] * 3
	for i in range(1, n + 1):
		z += i * (i + 1) // 2
		if z > n:
			break
		h += 1
	return h

def main():
	print(function1(int(input())))
main()


n = int(input())
result = 1
total = 0
temp = 0
for i in range(1, n + 1):
	temp += i
	total += temp
	if total > n:
		result = i - 1
		break
print(result)


t = int(input())
k = 0
i = 0
while k <= t:
	k = i * (i + 1) * (2 * i + 1) / 12 + i * (i + 1) / 4
	i += 1
print(i - 2)


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


cube = int(input())
soKhoi = 0
hang = 1
tongKhoi = 0
i = 0
while tongKhoi <= cube:
	i += 1
	soKhoi += i
	tongKhoi += soKhoi
print(i - 1)


n = int(input())
k = 1
v = 0
s = 0

def sss(x):
	y = 0
	for i in range(1, x + 1):
		y += i
	return y
while n >= s:
	s += sss(k)
	k += 1
	v += 1
print(v - 1)


(available, levels) = (int(input()), 0)
while True:
	required = (levels + 1) * (levels + 2) / 2
	if required <= available:
		levels += 1
		available -= required
	else:
		break
print(levels)


n = int(input())
i = 0
s = 0
while True:
	k1 = i * (i + 1) // 2
	s += k1
	if s >= n:
		if s > n:
			i = i - 1
		break
	i += 1
print(i)


n = int(input())
sum_height = 0
cubes_per_row = 0
height = 0
while True:
	height += 1
	cubes_per_row += height
	sum_height += cubes_per_row
	if sum_height > n:
		max_height = height - 1
		break
print(max_height)


n = int(input())
ups = 0
i = 0
h = 0
while True:
	i += 1
	ups += i
	n -= ups
	if n < 0:
		print(h)
		break
	else:
		h += 1


a = int(input())
s = 0
for j in range(1, 10000):
	t = j * (j + 1) // 2
	if a >= t:
		a -= t
		s += 1
	else:
		print(s)
		break


blocks = int(input())
for i in range(1, 999):
	summation = 0
	for a in range(1, i + 1):
		summation += a
	blocks -= summation
	if blocks < 0:
		i -= 1
		break
print(i)


number_changed = int(input()) * 6
curr_multiplication = 6
start_no = 1
while curr_multiplication <= number_changed:
	curr_multiplication = curr_multiplication / start_no
	curr_multiplication = curr_multiplication * (start_no + 3)
	start_no = start_no + 1
print(start_no - 1)


cubes = int(input())
bobthebuilder = 0
line = 0
adder = 1
heightcounter = 0
while cubes > bobthebuilder:
	line += adder
	adder += 1
	bobthebuilder += line
	if cubes >= bobthebuilder:
		heightcounter += 1
print(heightcounter)


from math import sqrt
n = int(input())
if n == 1:
	print(1)
else:
	i = 0
	while n >= 0:
		n -= i * (i + 1) / 2
		i += 1
	print(i - 2)


n = int(input())
i = 2
su = 1
co = 0
while n >= su:
	co += 1
	n -= su
	su += i
	i += 1
print(co)


n = int(input())
cubes_per_lvl = 1
lvl = 0
cubes = [1]
while n >= cubes_per_lvl:
	n -= cubes_per_lvl
	lvl += 1
	cubes_per_lvl += lvl + 1
print(lvl)


def main():
	n = int(input())
	i = 1
	x = 0
	while x <= n:
		x = i * (i + 1) * (i + 2) / 6
		i += 1
	print(i - 2)
main()


n = int(input())
i = 0
w = 0
l = []
while w < n and sum(l) <= n:
	i += 1
	w += i
	l.append(w)
if i == 1:
	print(i)
else:
	print(i - 1)


def func(n):
	x = n * (n + 1)
	x = x // 2
	return x
arr = [1]
cnt = 2
while True:
	x = func(cnt)
	x += arr[-1]
	if x > 10 ** 4:
		break
	else:
		arr.append(x)
	cnt += 1
n = int(input())
cnt = 1
for i in arr:
	if i <= n:
		ans = cnt
	else:
		break
	cnt += 1
print(ans)


def cubes(n):
	levels = 0
	for i in range(1, n + 1):
		req = i * (i + 1) // 2
		n -= req
		if n >= 0:
			levels += 1
		else:
			return levels
n = int(input())
if n == 1:
	print(1)
else:
	print(cubes(n))


k = int(input())
sumbetsu = 0
sumall = 0
for i in range(1, k + 2):
	sumbetsu += i
	sumall = sumall + sumbetsu
	if sumall > k:
		print(i - 1)
		break


def te(x):
	return x * (x + 1) // 2
n = int(input())
cnt = 0
i = 1
while n > 0:
	n -= te(i)
	if n < 0:
		break
	cnt += 1
	i += 1
print(cnt)


n = int(input())
i = 0
a = 1
while n - a >= 0:
	i = i + 1
	a = a + i
	n = n - a
print(i)


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


n = int(input())
arr = []
(a, p) = (0, 0)
for i in range(10007):
	a += i
	p += a
	arr.append(p)
for i in range(len(arr)):
	if n > arr[i]:
		continue
	elif n < arr[i]:
		output = i - 1
		break
	elif n == arr[i]:
		output = i
print(output)


all_sum = int(input())
ostatok = all_sum
result = []
max_element = 0
for mx in range(1, all_sum + 1):
	if all_sum <= 0:
		break
	max_element += mx
	if max_element > all_sum:
		max_element -= mx
	else:
		result.append(max_element)
	all_sum -= max_element
print(len(result))


n = int(input())
k = 1
i = 2
while n >= 0:
	n -= k
	k += i
	i += 1
print(i - 3)


def solve():
	pass

def main():
	n = int(input())
	h = 0
	buf = 0
	while buf <= n:
		h += 1
		buf += h * (h + 1) / 2
	print(h - 1)
main()


def main():
	n = 1
	i = 2
	x = int(input())
	while n < x + 1:
		n += i * (i + 1) // 2
		i += 1
	print(i - 2)
main()


import math
cube = int(input())
test = 1
test1 = 2
level = 0
cc = 1
while cc <= cube:
	level += 1
	test = test + test1
	test1 += 1
	cc += test
print(level)


n = int(input())
m = 1
z = 0
mm = 2
while m <= n:
	z = z + 1
	n = n - m
	m = m + mm
	mm = mm + 1
print(z)


from bisect import *
ls = []
for i in range(1, 10000 + 1):
	ls.append(i)
ls_sum = []
sum = 0
for i in ls:
	sum += i
	ls_sum.append(sum)
ls_sum_sum = []
sum = 0
for i in ls_sum:
	sum += i
	ls_sum_sum.append(sum)
n = int(input())
res = bisect_left(ls_sum_sum, n)
if n in ls_sum_sum:
	print(res + 1)
else:
	print(res)


n = int(input())
i = 0
a1 = x = 0
while a1 < n:
	x = x + i
	a1 = a1 + x
	i += 1
if a1 == n:
	print(i - 1)
else:
	print(i - 2)


n = int(input())
sumt = 0
t = 0
for i in range(10000):
	sumt += i * (i + 1) / 2
	if sumt > n:
		t = i - 1
		break
print(t)


n = int(input())
print(int((3 * n + (9 * n * n - 1 / 27) ** 0.5) ** (1 / 3) + (3 * n - (9 * n * n - 1 / 27) ** 0.5) ** (1 / 3) - 0.99999999))


def vanaya():
	a = int(input())
	level = 0
	cubes = 0
	i = 1
	if a == 1:
		return 1
	for i in range(1, a):
		cubes += i * (i + 1) / 2
		if cubes > a:
			break
		level += 1
		i += 1
	return level
print(vanaya())


kub = int(input())
floor = 1
next_floor = 1
while kub > 0 and next_floor <= kub:
	kub = kub - next_floor
	floor = floor + 1
	next_floor = next_floor + floor
print(floor - 1)


n = int(input())
(s, ans) = (0, 0)
d = 0
while s + d + ans + 1 <= n:
	ans += 1
	d += ans
	s += d
print(ans)


n = int(input())
a = x = k = 0
while k + a <= n:
	k += a
	x += 1
	a = a + x
else:
	x -= 1
	print(x)


from sys import stdin
nn = int(stdin.readline())
start = 1
if nn == start:
	if nn == 1:
		print(start)
else:
	end = 3
	endStart = 3
	ans = 4
	fin = 2
	while ans <= nn:
		endStart += end
		ans += endStart
		end += 1
		fin += 1
	print(fin - 1)


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


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


import sys
import math
input = sys.stdin.readline
n = int(input())
ans = 0
s = 1
j = 1
while n >= s:
	n -= s
	ans += 1
	j += 1
	s += j
print(ans)


n = int(input())
c = 0
lev = 0
while c <= n:
	lev += 1
	c += lev * (lev + 1) / 2
print(lev - 1)


n = int(input())
s = 0
e_c = 1
while n > 0:
	s = s + e_c
	e_c = e_c + 1
	n = n - s
if n < 0:
	e_c = e_c - 1
print(e_c - 1)


x = int(input())
i = 1
while True:
	s = i * (i + 1) * (i + 2) / 6
	if s > x:
		print(i - 1)
		break
	else:
		pass
	i += 1


n = int(input())
level = 0
totalCubes = 0
while totalCubes <= n:
	height = level
	level += 1
	totalCubes += level * (level + 1) / 2
print(height)


cubes = int(input())
height = 0
width = 1
while True:
	cubes -= width
	height += 1
	width += height + 1
	if cubes < width:
		break
print(height)


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


n = int(input())
a = [0 for i in range(100)]
for i in range(100):
	a[i] = (i + 1) * (i + 2) // 2
sum = 0
i = 0
while sum + a[i] <= n:
	sum += a[i]
	i += 1
print(i)


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


def sm(n):
	if n == 1:
		return n
	else:
		return n + sm(n - 1)
x = int(input())
i = 1
s = 0
c = 0
while s < x:
	s = s + sm(i)
	i = i + 1
	c = c + 1
if s == x:
	print(c)
else:
	print(c - 1)


n = int(input())
S = 0
Z = 0
i = 0
while n > Z:
	i = i + 1
	S = S + i
	Z = Z + S
	if n < Z:
		i = i - 1
print(i)


a = int(input())
c = 0
n = 0
for i in range(1, 100):
	c += (i ** 2 + i) / 2
	n += 1
	if c > a:
		print(n - 1)
		break
	elif c == a:
		print(n)
		break


n = int(input())
y = 0
N = 0
z = 0
Sum = 0
while Sum <= n:
	y += 1
	N = N + y
	Sum = N + Sum
	z += 1
	if Sum > n:
		print(z - 1)


p = 0
i = 1
k = 2
s = 0
x = int(input())
while i <= x:
	p += 1
	i = i + k
	s = s + i
	k += 1
	if s >= x:
		break
print(p)


n = int(input())
(c, k, s) = (0, 0, 0)
for i in range(1, n + 2):
	if k > n:
		break
	else:
		s = s + i
		k = s + k
		c += 1
print(c - 1)


n = int(input())
summ = 1
sum = 1
i = 1
while summ <= n:
	i += 1
	sum += i
	summ += sum
print(i - 1)


n = int(input())
if n == 1:
	print(1)
	exit()
yijingyong = 1
gaodu = 1
while yijingyong <= n:
	zheciyong = 0
	for i in range(1, gaodu + 2):
		zheciyong = zheciyong + i
	if yijingyong + zheciyong <= n:
		gaodu = gaodu + 1
		yijingyong = yijingyong + zheciyong
	else:
		print(gaodu)
		exit()


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


n = int(input())
i = 1
cnt = 0
ans = 0
while ans != 1:
	m = i * (i + 1) // 2
	n -= m
	if n >= 0:
		cnt += 1
	else:
		ans = 1
	i += 1
print(cnt)


n = int(input())
b = 0
i = 0
while n > b:
	i += 1
	b = b + i
	n = n - b
if n < 0:
	print(i - 1)
else:
	print(i)


k = int(input())
j = int((6 * k) ** (1 / 3)) - 3
for n in range(j, j + 5):
	if n * (n + 1) * (n + 2) // 6 > k:
		print(n - 1)
		break


n = int(input())
s = 0
j = 1
h = 0
while n > 0:
	s += j
	if n >= s:
		n -= s
		h += 1
		j += 1
	else:
		n = 0
print(h)


cubes = int(input())
lev_tot = 0
temp = 0
for i in range(0, 10000000):
	lev_tot += i
	temp += lev_tot
	if temp > cubes:
		break
	levels = i
print(levels)


n = int(input())
sum_of_sum = 0
i = 0
sum = 0
while sum_of_sum <= n:
	i += 1
	sum += i
	sum_of_sum = sum_of_sum + sum
print(i - 1)


n = int(input())
h = 0
k = 1
i = 1
r = 1
while k <= n and n // k > 0:
	h = h + 1
	i = i + 1
	r = r + i
	k = k + r
print(h)


n = int(input())
lines = 0
sum = 0
while sum < n:
	sum += lines * (lines + 1) // 2
	lines += 1
if n >= sum:
	print(lines - 1)
else:
	print(lines - 2)


tmp = int(input())
cnt = 0
while tmp >= 0:
	cnt += 1
	tmp -= cnt * (cnt + 1) / 2
print(cnt - 1)


n = int(input())
c = 0
s = 0
o = -1
u = 0
d = 0
while 1:
	c += 1
	s += c
	n -= s
	if s > n or s <= o:
		break
	else:
		d += 1
	o = s
if n >= 0:
	print(d + 1)
else:
	print(d)


n = int(input())
l = 1
i = 2
res = 0
while n >= l:
	res += 1
	n -= l
	l += i
	i += 1
print(res)


x = int(input())
sum = res = 0
while sum <= x:
	res += 1
	sum += res * (res + 1) / 2
print(res - 1)


a = int(input())
b = a
s = 0
j = 0
for i in range(1, 10000):
	j = j + i
	b = b - j
	if b < 0:
		break
	elif b == 0:
		s = s + 1
		break
	s = s + 1
print(s)


t = int(input())
n = 1
c = 0
while True:
	t = t - n * (n + 1) / 2
	n = n + 1
	c = c + 1
	if t < n * (n + 1) / 2:
		break
print(c)


n = int(input())
s = 1
h = [i for i in range(n + 1)]
l = [0 for i in range(n + 1)]
i = 1
s = 0
while s < n:
	l[i] = l[i - 1] + h[i]
	s += l[i]
	if s <= n:
		ans = h[i]
	else:
		ans = h[i - 1]
	i += 1
print(ans)


n = int(input())
s = 0
d = 0
k = 0
while n > 0:
	k += 1
	d += k
	s += 1
	n -= d
if n < 0:
	print(s - 1)
else:
	print(s)


cbs = int(input())
a = 0
b = 1
c = 2
while True:
	if cbs - b >= 0:
		cbs -= b
		a += 1
		b += c
		c += 1
	else:
		break
print(a)


s = int(input())
l = []
for i in range(1, 1000):
	c = 0
	for j in range(1, i + 1):
		c += j * (i - j)
	l.append(c)
ans = -1
for i in range(1000):
	if s >= l[i]:
		ans += 1
	else:
		break
print(ans)


def sum(n):
	return n * (n + 1) // 2
n = int(input())
(i, res) = (1, 0)
while i <= n * (n + 1):
	if res == n:
		print(i - 1)
		break
	if res > n:
		print(i - 2)
		break
	res += sum(i)
	i += 1


a = int(input())
r = 0
z = 0
while a >= r:
	r += (z + 1) * (z + 2) / 2
	z += 1
print(z - 1)


n = int(input())
cubes = 0
height = 0
while n >= cubes:
	height += 1
	level = height * (height + 1) // 2
	cubes += level
print(height - 1)


x = int(input())
n = 2
m = 0
while 1:
	m += (n + n ** 2) // 2
	if m >= x:
		break
	else:
		n += 1
print(n - 1)


n = int(input())
res = 0
s = 0
while n >= 0:
	res += 1
	s += res
	n -= s
print(res - 1)


n = int(input())
i = 1
y = 1
count = 0
c = 0
if n == 1:
	print('1')
else:
	while y <= n and c < n:
		count += 1
		i += 1
		y = y + i
		c += y
	print(count)


n = int(input())
level = 1
required = 1
while n >= required:
	n -= int(level * (level + 1) / 2)
	level += 1
	required = level * (level + 1) / 2
print(level - 1)


n = int(input())
level = 1
current = 1
while True:
	level += 1
	level_cubes = (1 + level) * level // 2
	current += level_cubes
	if current > n:
		level -= 1
		break
print(level)


cube = int(input())
m = 0
k = 1
sm = 0
if cube == 1:
	print(1)
else:
	while True:
		m += k
		sm += m
		if cube <= sm:
			break
		else:
			k += 1
	if cube == sm:
		print(k)
	else:
		print(k - 1)


def su(x):
	if x == 0:
		return 0
	else:
		return x + su(x - 1)
n = int(input())
c = 0
i = 1
while True:
	if n > 0:
		c += 1
		i += 1
	else:
		break
	n -= su(i)
print(c)


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())
p = 1
q = 1
while p <= n:
	p = q * (q + 1) * (q + 2)
	p = p / 6
	q += 1
print(q - 2)


n = int(input())
h = 0
x = 0
while x <= n:
	h = h + 1
	x = x + h * (h + 1) / 2
print(h - 1)


n = int(input())
count = 0
x = 1
y = 1
while n > 0 and x <= n:
	count += 1
	n = n - x
	y += 1
	x = x + y
print(count)


number_of_cubes = int(input())
height_of_pyramid = 0
while number_of_cubes > 0:
	needed_cubes = 0
	height_of_pyramid += 1
	for index in range(1, height_of_pyramid + 1):
		needed_cubes += index
	number_of_cubes = number_of_cubes - needed_cubes
	if number_of_cubes < 0:
		height_of_pyramid -= 1
print(height_of_pyramid)


n = int(input())
i = 0
s = 0
t = 0
k = 0
while 'True':
	i += s
	s += 1
	t += i
	if 0 < t <= n:
		k += 1
	if t >= n:
		break
print(k)


n = int(input())
Line = [1] * 100
for i in range(1, 50):
	Line[i] += Line[i - 1]
for i in range(1, 50):
	Line[i] += Line[i - 1]
for i in range(1, 50):
	Line[i] += Line[i - 1]
	if Line[i] > n:
		print(i)
		break


n = int(input())
height = 0
current_sum = 0
i = 0
while current_sum <= n:
	for j in range(i + 1):
		current_sum = current_sum + j + 1
	height = i
	i = i + 1
print(height)


no_of_cubes = int(input())
data = [0]
layer = 0
sum = 0
while data[layer] <= no_of_cubes:
	layer += 1
	if layer == 1:
		sum += data[layer - 1] + layer
		if sum > no_of_cubes:
			break
		else:
			data.append(layer)
	elif layer == 2:
		sum += data[layer - 1] + layer
		if sum > no_of_cubes:
			break
		else:
			data.append(data[layer - 1] + layer)
	elif layer > 2:
		if data[layer - 1] + layer < no_of_cubes:
			sum += data[layer - 1] + layer
			if sum > no_of_cubes:
				break
			else:
				data.append(data[layer - 1] + layer)
		else:
			break
print(len(data) - 1)


n = int(input())
s = 0
list = []
for i in range(1, n + 1):
	s = s + i
	list.append(s)
	if sum(list) > n:
		print(i - 1)
		break
	if n == 1:
		print('1')


n = int(input())
h = 0
cost = 0
while n >= cost:
	for i in range(1, n + 1):
		cost += i
		if n >= cost:
			h += 1
			n += -cost
print(h)


N = int(input())
for i in range(0, 100):
	if i * (i + 1) * (i + 2) / 6 > N:
		print(i - 1)
		break
	elif i * (i + 1) * (i + 2) / 6 == N:
		print(i)
		break


cubes = int(input())

def cubes_on_level(x):
	for i in range(1, x):
		yield sum(range(1, i + 1))
i = 1
levels = list(cubes_on_level(50))
while cubes > 0:
	cubes -= levels[i]
	i += 1
print(i - 1)


n = int(input())
sum = 0
p = 0
i = 0
d = 0
a = []
sum1 = 0
while sum1 <= n:
	p = p + 1
	sum = sum + p
	sum1 = sum + sum1
	a.append(sum)
	i = i + 1
d = len(a)
print(d - 1)


a = int(input())
count = 0
last = 0
current = 0
while a > 0:
	count += 1
	current = last + count
	last = current
	a -= current
	if a < 0:
		count -= 1
print(count)


blocks = int(input())
steps = 1
stair = 1
while blocks >= stair:
	blocks -= stair
	steps += 1
	stair += steps
print(steps - 1)


n = int(input())
e = 0
a = 0
while n > 0:
	e += 1
	n -= e + a
	a += e
if n < 0:
	print(e - 1)
else:
	print(e)


import pdb
c = 0
c1 = 0
x = int(input())
for i in range(1, x + 1):
	c1 += i
	if x >= c1:
		x -= c1
		c += 1
	if x < c1:
		break
print(c)


def no_ofcube(n):
	sum = 0
	for i in range(1, n + 1):
		sum += i
	return sum
n = int(input())
(sum, cnt) = (0, 0)
for i in range(1, n + 1):
	sum += no_ofcube(i)
	if sum > n:
		break
	cnt += 1
print(cnt)


f = lambda : map(int, input().split())
n = int(input())
s = 1
while n >= s * (s + 1) * (s + 2) // 6:
	s += 1
print(s - 1)


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


n = int(input())
c = 1
l = 0
while 1:
	val = c * (c + 1) // 2
	if n >= val:
		l = l + 1
		n = n - val
	else:
		break
	c = c + 1
print(l)


n = int(input(''))

def xy(i):
	z = 0
	for j in range(0, i + 1):
		z = z + j
	return z
d = 0
e = 0
i = 0
f = 0
while e <= n:
	i = i + 1
	f = xy(i)
	e = e + f
	d = d + 1
print(d - 1)


n = int(input())
levels = 0
blocks = 1
add = 2
used = 0
while True:
	if used + blocks > n:
		break
	else:
		levels += 1
		used += blocks
		blocks += add
		add += 1
print(levels)


n = int(input())
count = 0
result = 0
ls = []
for i in range(1, n + 1):
	ls.append(i)
	result += sum(ls)
	if result > n:
		break
	count += 1
if count == 0 and n != 0:
	count = 1
print(count)


tri = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035]
n = int(input())
tritot = 0
for i in range(len(tri)):
	tritot = tritot + tri[i]
	if n < tritot:
		print(i)
		break


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
level = 0
box_required = 1
inc_by = 2
while n > 0:
	if n >= box_required:
		level += 1
		n -= box_required
		box_required += inc_by
		inc_by += 1
	else:
		n = 0
print(level)


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
n = qi()
c = 0
i = 0
while c <= n:
	i += 1
	c += i * (i + 1) // 2
print(i - 1)


n = int(input())
prev = 1
n = n - prev
height = 0
i = 1
while n >= 0:
	height += 1
	i += 1
	prev = prev + i
	n -= prev
print(height)


import sys
from math import floor, ceil, sqrt

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return [self.nextint() for i in range(n)]

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
n = nextint()
(i, l) = (0, 0)
while i < n:
	l += 1
	for j in range(l + 1):
		i += j
if i > n:
	l -= 1
print(l)


cubes = int(input())
level = 0
count_cubes_in_level = 0
all_cubes_in_form = 0
while all_cubes_in_form < cubes:
	level += 1
	count_cubes_in_level += level
	all_cubes_in_form += count_cubes_in_level
if all_cubes_in_form == cubes:
	print(level)
else:
	print(level - 1)


cubes = int(input())
if cubes == 0:
	height = 0
if cubes == 1:
	height = 1
if cubes > 1:
	height = 1
	lastUsedCube = 1
	totalUsedCup = 1
	while totalUsedCup < cubes:
		height += 1
		lastUsedCube += height
		totalUsedCup += lastUsedCube
		if totalUsedCup - cubes > 0:
			height -= 1
print(height)


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


k = int(input())
f = lambda x: x * (x + 1) // 2
x = 1
while k - f(x) >= 0:
	k -= f(x)
	x += 1
print(x - 1)


a = int(input())
height = 0
length = 1
i = 2
while length <= a:
	length += i * (i + 1) / 2
	height += 1
	i += 1
print(height)


import sys
import math
n = int(sys.stdin.readline())
k = 1
i = 2
res = 1
sumv = 1
while sumv < n:
	k += i
	sumv += k
	i += 1
	res += 1
if sumv > n:
	res -= 1
print(res)


x = int(input())
s = 0
s1 = 0
s2 = 0
while s < x:
	s1 += 1
	s2 += s1
	s += s2
if s > x:
	s1 -= 1
print(s1)


n = int(input())
height = 1
volume = 1
while volume <= n:
	height += 1
	volume += height * (height + 1) // 2
print(height - 1)


N = int(input())
a = 1
h = 0
k = 0
while N > k:
	h += a
	k += h
	a += 1
if N == k:
	print(a - 1)
else:
	print(a - 2)


t = int(input())
num_cubes = 0
counter = 0
while num_cubes <= t:
	counter = counter + 1
	cubes = sum(range(counter + 1))
	num_cubes = num_cubes + cubes
print(counter - 1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
dp = dd(int)
dp[1] = 1
i = 2
while True:
	dp[i] = dp[i - 1] + i
	if dp[i] > pow(10, 5):
		break
	i += 1
answer = 0
n = int(data())
i = 1
while n > 0:
	if dp[i] <= n:
		n -= dp[i]
		answer += 1
	else:
		break
	i += 1
out(answer)


n = int(input())
s = 0
p = 0
for i in range(1, 1000):
	if s + p + i > n:
		print(i - 1)
		break
	p += i
	s += p


n = int(input())
if 1 <= n <= 3:
	print(1)
else:
	sum = 0
	count = 1
	block = 0
	while sum <= n:
		for i in range(1, count + 1):
			sum = sum + i
		count += 1
		block += 1
	print(block - 1)


no = int(input())
j = 3
count = 0
sum = 1
if no != 0:
	if no == 1:
		count = 1
	else:
		count = 1
		while sum + j <= no:
			count = count + 1
			sum = sum + j
			j = 0
			for k in range(count + 2):
				j = j + k
print(count)


def c(h):
	return (h + 1) * (h + 2) // 2
n = int(input())
h = 0
while True:
	if c(h) > n:
		break
	n -= c(h)
	h += 1
print(h)


total = int(input())
used = 0
miterator = 0
while total > used:
	miterator += 1
	used += sum(range(miterator + 1))
if used > total:
	miterator -= 1
print(miterator)


number = int(input())
for i in range(1, 41):
	term = int((i * i * i + 3 * i * i + 2 * i) / 6)
	if term > number:
		break
print(i - 1)


n = int(input())
x = 2
a = 1
while a <= n:
	a += x * (x + 1) / 2
	x += 1
print(x - 2)


def main():
	n = int(input())
	ans = 0
	i = inc = 1
	while ans + inc <= n:
		ans += inc
		i += 1
		inc = i * (i + 1) // 2
	print(i - 1)
main()


n = int(input())
count = 0
sum = 1
aux = 1
while count < n:
	aux += 1
	sum += aux
	count += sum
print(aux - 1)


import sys
import itertools as it
import bisect as bi
import math as mt
import collections as cc
S = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
(n,) = I()
f = lambda x: x * (x + 1) // 2
ar = [f(i) for i in range(100)]
for i in range(1, len(ar)):
	ar[i] += ar[i - 1]
print(bi.bisect(ar, n) - 1)


j = int(input())

def pyramid_height(cubes):
	additional_cubes = 1
	curr_layer_cubes = 0
	height = 0
	while True:
		curr_layer_cubes += additional_cubes
		cubes -= curr_layer_cubes
		if cubes < 0:
			return height
		height += 1
		additional_cubes += 1
print(pyramid_height(j))


n = int(input())
count = 1
while n:
	nBlocks = count * (count + 1) / 2
	if nBlocks <= n:
		n -= nBlocks
		count += 1
	else:
		break
print(count - 1)


n = int(input())

def lev(n):
	return (n + 1) * n / 2
i = 0
while n > -1:
	i += 1
	n -= lev(i)
print(i - 1)


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


n = int(input())
c = 1
l = 1
while n >= l:
	l += c
	n -= l
	c += 1
print(c - 1)


def parse_input() -> int:
	return int(input())

def _solve(n: int, h: int) -> int:
	w = int(h * (h + 1) / 2)
	if n < w:
		return h - 1
	return _solve(n - w, h + 1)

def solve(n: int) -> int:
	return _solve(n, 1)
print(solve(parse_input()))


n = int(input())
x = 0
i = 1
tab = []
while sum(tab) <= n:
	x += i
	tab.append(x)
	i += 1
print(len(tab) - 1)


n = int(input())
i = 1
while n > 0:
	i += 1
	n = n - sum(list(range(1, i + 1)))
print(i - 1)


n = int(input())
i = 1
while True:
	if i * (i + 1) * (i + 2) / 6 > n:
		break
	i += 1
print(i - 1)


n = int(input())
(level, dif) = (0, 1)
pieces = 1
while n - pieces >= 0:
	n -= pieces
	level += 1
	dif += 1
	pieces += dif
print(level)


n = int(input())
s = 0
lst = []
for i in range(1, n + 1):
	s = s + i
	lst.append(s)
	if sum(lst) > n:
		lst.remove(lst[-1])
		break
print(len(lst))


n = int(input())
h = 0
used = 0
while used <= n:
	h += 1
	used += h * (h + 1) // 2
print(h - 1)


n = int(input())
e = 0
i = 0
c = 0
while c <= n:
	e += 1
	i += e
	c += i
print(e - 1)


n = int(input())
count = 1
sum1 = 0
pyramid = []
while 1:
	for i in range(1, count + 1):
		sum1 += i
	pyramid.append(sum1)
	sum1 = 0
	if sum(pyramid) > n:
		break
	count += 1
print(count - 1)


cubes = int(input())
n = 1
while True:
	temp = n * (n + 1) / 2
	if temp <= cubes:
		cubes -= temp
		n += 1
	else:
		n -= 1
		break
print(n)


n = int(input())
su = 0
for i in range(1, n + 2):
	p = i * (i + 1)
	p1 = p // 2
	su = su + p1
	if su > n:
		print(i - 1)
		break


from collections import deque
import math
import os
import random
import re
import sys

def main():
	n = int(input())
	cnt = 0
	h = 0
	i = 0
	while cnt <= n:
		h += 1
		cnt += h * (h + 1) // 2
	print(h - 1)
main()


a = int(input())
if a == 1:
	print(1)
else:
	counter = 1
	while a >= counter * (counter + 1) // 2:
		a -= counter * (counter + 1) // 2
		counter += 1
	print(counter - 1)


N = float(input())
v6N1o3 = (6 * N) ** 0.3333333333333333
L = v6N1o3 + 0.3333333333333333 / v6N1o3 - 1.0
print(int(L + 1e-06))


args = int(input())
lst = []
while True:
	sigma = sum(list(range(1, len(lst) + 2)))
	if sum(lst) + sigma <= args:
		if lst == []:
			lst.append(1)
		else:
			lst.append(sigma)
	else:
		break
print(len(lst))


n = int(input())
data = [1]
data_result = [1]
i = 0
while 1:
	if data_result[i] > n:
		print(i)
		exit()
	data.append(data[i] + i + 2)
	data_result.append(data_result[i] + data[i + 1])
	i += 1


n = int(input())
cnt = 0
f = 1
while n - f >= 0:
	cnt += 1
	n -= f
	f += cnt + 1
print(cnt)


n = int(input())
agg = 0
count = 0
x = 1
while 1:
	for i in range(x):
		agg += i
	x += 1
	if agg > n:
		break
	count += 1
print(count - 1)