import fractions N = input() print fractions.gcd(N, N*(N+1)/2)