

N = int(eval(input()))



count = 0

i = 0

buff = 0

a = []

ans = 0

while True:

    a.append(buff)

    if buff >= N:

        break

    i += 1

    buff += i

print(i)
N = int(eval(input()))



ans = 0



for i in range(N+1):

    ans += i

    if N <= ans:

        print(i)

        exit()
N = int(eval(input()))
count = 0
i = 0
buff = 0
a = []
ans = 0
while True:
    a.append(buff)
    if buff >= N:
        break
    i += 1
    buff += i
print(i)

N = int(eval(input()))
ans = 0
for i in range(N + 1):
    ans += i
    if N <= ans:
        print(i)
        exit()

-count = 0 -i = 0 -buff = 0 -a = [] -while True: -    a.append(buff) -    if buff >= N: -        break -    i += 1 -    buff += i -print(i) +for i in range(N + 1): +    ans += i +    if N <= ans: +        print(i) +        exit()