import math N = int(input()) k = int(math.isqrt(2 * N)) print(N - k)