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