import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long x = getGCD(n, (long)n * (n + 1) / 2); System.out.println(x); } static long getGCD(long x, long y) { if (x % y == 0) { return y; } else { return getGCD(y, x % y); } } }