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

6f5a99d6c3e21cbde1352cfbee4689b4ef0f44a0
<mask token>

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

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