n = int(input()) s1 = n * (n+1) // 2 s2 = (n+2) * (n+1) // 2 - 1 def gcd(a, b): while b > 0 : a, b = b, a%b return a print(gcd(s1, s2))