from math import gcd n = int(input()) print(gcd(n, n * (n + 1) // 2))