x = int(eval(input()))

temp = 0

for i in range(x+1):

    temp += i

    if temp >= x:

        print(i)

        exit()

x = int(eval(input()))

for i in range(10**6):

    if i*(i+1)//2 >= x:

        print(i)

        exit()

x = int(eval(input()))
temp = 0
for i in range(x + 1):
    temp += i
    if temp >= x:
        print(i)
        exit()

x = int(eval(input()))
for i in range(10**6):
    if i * (i + 1) // 2 >= x:
        print(i)
        exit()

-temp = 0 -for i in range(x + 1): -    temp += i -    if temp >= x: +for i in range(10**6): +    if i * (i + 1) // 2 >= x: