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