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