import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num=Integer.parseInt(br.readLine()); br.close(); long sum1=0,sum2=0; int i; for(i=1;i<=num;i++){ sum1+=i; sum2+=i+1; } System.out.println(euclid(sum2,sum1)); } public static long euclid(long a,long b){ if(b==0){ return a; }else{ return euclid(b,a%b); } } }