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