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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.InputStreamReader;
import java.io.Writer;
import java.io.BufferedReader;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Nipuna Samarasekara
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    FastScanner in = new FastScanner(inputStream);
    FastPrinter out = new FastPrinter(outputStream);
    TaskA solver = new TaskA();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskA {

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
      int[] primes = IntegerUtils.generatePrimes(1000007);
      int n = in.nextInt();
      for (int i = 1; ; i++) {
        if (Arrays.binarySearch(primes, i * n + 1) < 0) {
          out.println(i);
          return;
        }
      }

    }

  }

  static class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
      super(new InputStreamReader(is));
    }


    public int read() {
      try {
        int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
        return ret;
      } catch (IOException e) {
        throw new InputMismatchException();
      }
    }

    static boolean isWhiteSpace(int c) {
      return c >= 0 && c <= 32;
    }

    public int nextInt() {
      int c = read();
      while (isWhiteSpace(c)) {
        c = read();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = read();
      }
      int ret = 0;
      while (c >= 0 && !isWhiteSpace(c)) {
        if (c < '0' || c > '9') {
          throw new NumberFormatException("digit expected " + (char) c
              + " found");
        }
        ret = ret * 10 + c - '0';
        c = read();
      }
      return ret * sgn;
    }

    public String readLine() {
      try {
        return super.readLine();
      } catch (IOException e) {
        return null;
      }
    }

  }

  static class IntArrayList extends IntList {

    private int[] array;
    private int size;

    public IntArrayList() {
      this(10);
    }

    public IntArrayList(int capacity) {
      array = new int[capacity];
    }

    public IntArrayList(IntList list) {
      this(list.size());
      addAll(list);
    }


    public int get(int index) {
      if (index >= size) {
        throw new IndexOutOfBoundsException();
      }
      return array[index];
    }


    public int size() {
      return size;
    }


    public void add(int value) {
      ensureCapacity(size + 1);
      array[size++] = value;
    }

    public void ensureCapacity(int newCapacity) {
      if (newCapacity > array.length) {
        int[] newArray = new int[Math.max(newCapacity, array.length << 1)];
        System.arraycopy(array, 0, newArray, 0, size);
        array = newArray;
      }
    }


    public int[] toArray() {
      int[] array = new int[size];
      System.arraycopy(this.array, 0, array, 0, size);
      return array;
    }

  }

  static abstract class IntCollection {

    public abstract IntIterator iterator();

    public abstract int size();

    public abstract void add(int value);

    public int[] toArray() {
      int size = size();
      int[] array = new int[size];
      int i = 0;
      for (IntIterator iterator = iterator(); iterator.isValid(); iterator.advance()) {
        array[i++] = iterator.value();
      }
      return array;
    }

    public void addAll(IntCollection values) {
      for (IntIterator it = values.iterator(); it.isValid(); it.advance()) {
        add(it.value());
      }
    }

  }

  static abstract class IntList extends IntCollection implements Comparable<IntList> {

    public abstract int get(int index);


    public IntIterator iterator() {
      return new IntIterator() {
        private int size = size();
        private int index = 0;

        public int value() throws NoSuchElementException {
          if (!isValid()) {
            throw new NoSuchElementException();
          }
          return get(index);
        }

        public void advance() throws NoSuchElementException {
          if (!isValid()) {
            throw new NoSuchElementException();
          }
          index++;
        }

        public boolean isValid() {
          return index < size;
        }
      };
    }

    public int hashCode() {
      int hashCode = 1;
      for (IntIterator i = iterator(); i.isValid(); i.advance()) {
        hashCode = 31 * hashCode + i.value();
      }
      return hashCode;
    }


    public boolean equals(Object obj) {
      if (!(obj instanceof IntList)) {
        return false;
      }
      IntList list = (IntList) obj;
      if (list.size() != size()) {
        return false;
      }
      IntIterator i = iterator();
      IntIterator j = list.iterator();
      while (i.isValid()) {
        if (i.value() != j.value()) {
          return false;
        }
        i.advance();
        j.advance();
      }
      return true;
    }

    public int compareTo(IntList o) {
      IntIterator i = iterator();
      IntIterator j = o.iterator();
      while (true) {
        if (i.isValid()) {
          if (j.isValid()) {
            if (i.value() != j.value()) {
              if (i.value() < j.value()) {
                return -1;
              } else {
                return 1;
              }
            }
          } else {
            return 1;
          }
        } else {
          if (j.isValid()) {
            return -1;
          } else {
            return 0;
          }
        }
        i.advance();
        j.advance();
      }
    }

  }

  static class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
      super(out);
    }

    public FastPrinter(Writer out) {
      super(out);
    }

  }

  static interface IntIterator {

    public int value() throws NoSuchElementException;

    public void advance() throws NoSuchElementException;

    public boolean isValid();

  }

  static class IntegerUtils {

    public static int[] generatePrimes(int upTo) {
      boolean[] isPrime = generatePrimalityTable(upTo);
      IntList primes = new IntArrayList();
      for (int i = 0; i < upTo; i++) {
        if (isPrime[i]) {
          primes.add(i);
        }
      }
      return primes.toArray();
    }

    public static boolean[] generatePrimalityTable(int upTo) {
      boolean[] isPrime = new boolean[upTo];
      if (upTo < 2) {
        return isPrime;
      }
      Arrays.fill(isPrime, true);
      isPrime[0] = isPrime[1] = false;
      for (int i = 2; i * i < upTo; i++) {
        if (isPrime[i]) {
          for (int j = i * i; j < upTo; j += i) {
            isPrime[j] = false;
          }
        }
      }
      return isPrime;
    }

  }
}