Problem: PolandBall is a young, clever Ball. He is interested in prime numbers. He has stated a following hypothesis: "There exists such a positive integer n that for each positive integer m number n·m + 1 is a prime number".

Unfortunately, PolandBall is not experienced yet and doesn't know that his hypothesis is incorrect. Could you prove it wrong? Write a program that finds a counterexample for any n.

Input

The only number in the input is n (1 ≤ n ≤ 1000) — number from the PolandBall's hypothesis. 

Output

Output such m that n·m + 1 is not a prime number. Your answer will be considered correct if you output any suitable m such that 1 ≤ m ≤ 103. It is guaranteed the the answer exists.

Examples

Input

3


Output

1

Input

4


Output

2

Note

A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.

For the first sample testcase, 3·1 + 1 = 4. We can output 1.

In the second sample testcase, 4·1 + 1 = 5. We cannot output 1 because 5 is prime. However, m = 2 is okay since 4·2 + 1 = 9, which is not a prime number.

Solution (in JAVA):

Solution:


import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;


import java.util.*;

public class random_num {
public static long x,y,d;
public static int MOD= (int) (Math.pow(10,9)+8);
	public static void main(String args[]){
		InputReader s= new InputReader(System.in);
		OutputStream outputStream= System.out;
		PrintWriter out= new PrintWriter(outputStream);
		int a[]=new int[1000002];
		ArrayList<Integer> b=new ArrayList();
		a=sieve(1000001);
		b.add(2);
		b.add(3);
		for(int i=5;i<a.length;i++){
			if(a[i]==0){
				b.add(i);
			}
		}
		int n=s.nextInt();
		int flag=0;
		for(int i=1;i<=1000;i++){
			int x=Collections.binarySearch(b, n*i+1);
			if(x<0){
				System.out.println(i);
				flag=1;
				break;
			}
			
		}
		out.close();
	}
	static class Pair1{
		public int xx;
		public int yy;
		public Pair1(int xx,int yy){
			this.xx=xx;
			this.yy=yy;
		}
		
	}
	static boolean isPrime(long x){
		for(int i=2;i<=Math.sqrt(x)+1;i++){
			if(x%i==0 && i!=x)
				return false;
		}
		return true;
	}
	static class InputReader {
		
	    public BufferedReader reader;
	    public StringTokenizer tokenizer;
 
	    public InputReader(InputStream inputstream) {
	      reader = new BufferedReader(new InputStreamReader(inputstream));
	      tokenizer = null;
	    }
	    
	    public String nextLine(){
	    	String fullLine=null;
	    	while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	              fullLine=reader.readLine();
	            } catch (IOException e) {
	              throw new RuntimeException(e);
	            }
	            return fullLine;
	          }
	          return fullLine;
	    }
		public String next() {
	      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	        try {
	          tokenizer = new StringTokenizer(reader.readLine());
	        } catch (IOException e) {
	          throw new RuntimeException(e);
	        }
	      }
	      return tokenizer.nextToken();
	    }
		public long nextLong() {
		      return Long.parseLong(next());
		    }
	    public int nextInt() {
	      return Integer.parseInt(next());
	    }
	  }
	
	public static Object1 phi(int n)
	{
		double result = n; 
		ArrayList<Integer> a=new ArrayList();
		// Consider all prime factors of n and for every prime
		// factor p, multiply result with (1 - 1/p)
		for (int p=2; p*p<=n; ++p)
		{
			// Check if p is a prime factor.
			if (n % p == 0)
			{
			   a.add(p);
				// If yes, then update n and result
				while (n % p == 0)
					n /= p;
				result *= (1.0 - (1.0 / (double) p));
			}
		}

		// If n has a prime factor greater than sqrt(n)
		// (There can be at-most one such prime factor)
		if (n > 1){
		    a.add(n);
		    result *= (1.0 - (1.0 / (double) n));
		}
		Object1 o=new Object1((long)result,a);

		return o;
	}
	static class Object1{
		public long count;
		public ArrayList<Integer> list;
		public Object1(long n,ArrayList<Integer> a){
			this.count=n;
			this.list=a;
		}
	}
	public static HashMap<Integer,Long> getcatalan(int n){
		HashMap<Integer,Long> a=new HashMap<Integer,Long>();
		a.put(0,(long)1);
		for(int i=1;i<=n+1;i++){
			long m=2*(2*i-1);
			long m1=m*a.get(i-1);
			long m3=m1/(i+1);
			//out.println(m+" "+m1+" "+m2+" "+m3);
			
			a.put(i,m3%1000000007);
		}
		return a;
	}
	

	// return smallest number of an array of int
	public static int getSmallest(int[] x) {
	    int smallest = x[0];
	    for(int i = 1; i < x.length; ++i) {
	        if(x[i] < smallest)
	            smallest = x[i];
	    }
	    return smallest;
	}
	public static int gcd(int number1, int number2) {  
		if(number2 == 0){
			return number1;
		} 
		return gcd(number2, number1%number2); 
	}
	
	public static void extendedEuclidean(long a,long b){
		if(b == 0) {
	        d = a;
	        x = 1;
	        y = 0;
	    }
	    else {
	        extendedEuclidean(b, a%b);
	        long temp = x;
	        x = y;
	        y = temp - (a/b)*y;
	    }
	}
	
	public static int combinations(int n,int r){
		if(n==r) return 1;
		if(r==1) return n;
		if(r==0) return 1;
		return combinations(n-1,r)+ combinations(n-1,r-1);
	}
	public static long binomialCoeff(int n, int k)
	{
	    long C[][]= new long[n+1][k+1];
	    int i, j;
	 
	    // Caculate value of Binomial Coefficient in bottom up manner
	    for (i = 0; i <= n; i++)
	    {
	        for (j = 0; j <= Math.min(i, k); j++)
	        {
	            // Base Cases
	            if (j == 0 || j == i)
	                C[i][j] = 1;
	 
	            // Calculate value using previosly stored values
	            else
	                C[i][j] = C[i-1][j-1] + C[i-1][j];
	        }
	    }
	 
	    return C[n][k];
	}
	public static long expo(long a, long b){
	    if (b==1)
	        return a;
	    if (b==2)
	        return a*a;

	    if (b%2==0){
	            return expo(expo(a,b/2),2);
	    }
	    else{
	        return a*(expo(expo(a,(b-1)/2),2));
	    }
	}
	
	static long modPow(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	
	public static int[] sieve(int N){
		int arr[]= new int[N+1];
		int b[]=new int[N+1];
		for(int i=2;i<Math.sqrt(N);i++){
			if(arr[i]==0){
				
				for(int j= i*i;j<= N;j= j+i){
					arr[j]=1;
				}
			}
		}
		return arr;
		// All the i for which arr[i]==0 are prime numbers.
	}
	static class Pair implements Comparable<Pair>
    {
        int f,s;
        Pair(int ii, int cc)
        {
            f=ii;
            s=cc;
        }
        
        public int compareTo(Pair o) 
        {
            return Integer.compare(this.f, o.f);
        }
        
    }
	public static class company{
		public int t;
		public int d;
		public company(int m,int f){
			this.t=m;
			this.d=f;
		}

	}
	public static class pair_comparator implements Comparator<Pair1>{

		@Override
		public int compare(Pair1 arg0, Pair1 arg1) {
			// TODO Auto-generated method stub
			return arg0.xx-arg1.xx;
		}
		
	}
	
	public static ArrayList<Integer> simpleSieve(int limit,ArrayList<Integer> prime)
	{
		// Create a boolean array "mark[0..n-1]" and initialize
		// all entries of it as true. A value in mark[p] will
		// finally be false if 'p' is Not a prime, else true.
		boolean[] mark=new boolean[limit+1];
		for(int i=0;i<limit+1;i++){
			mark[i]=true;
		}

		for (int p=2; p*p<limit; p++)
		{
			// If p is not changed, then it is a prime
			if (mark[p] == true)
			{
				// Update all multiples of p
				for (int i=p*2; i<limit; i+=p)
					mark[i] = false;
			}
		}

		// Print all prime numbers and store them in prime
		for (int p=2; p<limit; p++)
		{
			if (mark[p] == true)
			{
				prime.add(p);
				//System.out.println(p+",");
			}
		}
		return prime;
	}

	// Prints all prime numbers smaller than 'n'
	public static ArrayList<Integer> segmentedSieve(int n)
	{
		// Compute all primes smaller than or equal
		// to square root of n using simple sieve
		int limit = (int) (Math.floor(Math.sqrt(n))+1);
		ArrayList<Integer> prime=new ArrayList<Integer>(); 
		prime=simpleSieve(limit, prime); 

		// Divide the range [0..n-1] in different segments
		// We have chosen segment size as sqrt(n).
		int low = limit;
		int high = 2*limit;

		// While all segments of range [0..n-1] are not processed,
		// process one segment at a time
		while (low < n)
		{
			// To mark primes in current range. A value in mark[i]
			// will finally be false if 'i-low' is Not a prime,
			// else true.
			boolean[] mark=new boolean[limit+1];
			for(int i=0;i<limit+1;i++){
				mark[i]=true;
			}
			//memset(mark, true, sizeof(mark));

			// Use the found primes by simpleSieve() to find
			// primes in current range
			for (int i = 0; i < prime.size(); i++)
			{
				// Find the minimum number in [low..high] that is
				// a multiple of prime[i] (divisible by prime[i])
				// For example, if low is 31 and prime[i] is 3,
				// we start with 33.
				int loLim = (int) (Math.floor(low/prime.get(i)) * prime.get(i));
				if (loLim < low)
					loLim += prime.get(i);

				/* Mark multiples of prime[i] in [low..high]:
					We are marking j - low for j, i.e. each number
					in range [low, high] is mapped to [0, high-low]
					so if range is [50, 100] marking 50 corresponds
					to marking 0, marking 51 corresponds to 1 and
					so on. In this way we need to allocate space only
					for range */
				for (int j=loLim; j<high; j+=prime.get(i))
					mark[j-low] = false;
			}

			// Numbers which are not marked as false are prime
			for (int i = low; i<high; i++)
				if (mark[i - low] == true){
					prime.add(i);
					//System.out.println(i+",");
				}
			// Update low and high for next segment
			low = low + limit;
			high = high + limit;
			if (high >= n) high = n;
		}
		return prime;
	}
}