import java.util.Scanner; class Main { public static long gcd(long x, long y) { long r; if (y < x) { r = x; x = y; y = r; } while (y > 0) { r = x % y; x = y; y = r; } return x; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextInt(); sc.close(); System.out.print(gcd(N, (N - 1) * N / 2)); } }