n=int(eval(input()))

count,add=0,0

while True:

    if n<=count:

        break

    add+=1

    count+=add

print(add)
x=int(eval(input()))

import math

print((math.ceil((-1+math.sqrt(1+8*x))/2)))
n = int(eval(input()))
count, add = 0, 0
while True:
    if n <= count:
        break
    add += 1
    count += add
print(add)

x = int(eval(input()))
import math

print((math.ceil((-1 + math.sqrt(1 + 8 * x)) / 2)))

-n = int(eval(input())) -count, add = 0, 0 -while True: -    if n <= count: -        break -    add += 1 -    count += add -print(add) +x = int(eval(input())) +import math + +print((math.ceil((-1 + math.sqrt(1 + 8 * x)) / 2)))