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