#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 3;
    exit(0);
  }
  if (n == 2) {
    cout << 4;
    exit(0);
  }
  cout << n - 2;
  return 0;
}
