n = int(input()) count = 0 now = n for i in range(1,n+5): now -= i count += 1 if now < 1: ans = count now += i ans = max(ans,now) break print(ans)