import java.util.Scanner;
public class d063{
public static void main(String[]argv){
Scanner sc=new Scanner(System.in);int a,b;
while(sc.hasNext()){a=sc.nextInt();
b=a==1?(a-1):(a+1);System.out.println(b);}}}