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