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