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(); int sum1=0,sum2=0,i; for(i=1;i<=num;i++){ sum1+=i; sum2+=i+1; } System.out.println(euclid(sum2,sum1)); } public static int euclid(int a,int b){ if(b==0){ return a; }else{ return euclid(b,a%b); } } }