import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from fractions import gcd from functools import reduce N = int(read()) def f(x): return (x+x+N-1) * N // 2 A = [f(x) for x in range(10)] answer = reduce(gcd, A) print(answer)