#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // dequef
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <climits>

#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using ld = long double;
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(a) (a).begin(), (a).end()
#define mod 1000000007
using namespace std;
ll gcd(ll a, ll b){
  if(a % b == 0) return b;
  return gcd(b, a % b);
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}
int main(){
  int n;
  cin >> n;
  ll ans = 1;
  for(int i = 2; i <= n; i++) ans = lcm(ans, i);
  cout << ans + 1 << endl;
}
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //a
  long long lcm = 1;
  int n;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    long long g = __gcd(lcm, i);
    lcm = lcm * i / g;
  }
  lcm++;
  assert(lcm <= 1e13);
  for (int i = 2; i <= n; i++) {
    cerr << "i = " << i << " rem = " << lcm % i << endl;
    assert((lcm % i) == 1);
  }
  cout << lcm << endl;
  return 0;
}