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

d4d40922019e15ae23175f77909660ff15d5b12f
<mask token>

<mask token>
while n <= s:
    n -= s
    i += 1
    s += i
print(i - 1)

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