a = int(eval(input()))

s = 0

if a < 3:print(a)

else:

    for i in range(1,a):



        s+=i

        if s-i < a <= s:

            print(i)

            break
a = int(eval(input()))

s = 0

for i in range(1,a+1):

  s+=i

  if s>=a:

    print(i)

    break
a = int(eval(input()))
s = 0
if a < 3:
    print(a)
else:
    for i in range(1, a):
        s += i
        if s - i < a <= s:
            print(i)
            break

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

-if a < 3: -    print(a) -else: -    for i in range(1, a): -        s += i -        if s - i < a <= s: -            print(i) -            break +for i in range(1, a + 1): +    s += i +    if s >= a: +        print(i) +        break