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