#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
    // #define LOCAL
#ifdef LOCAL
    freopen("in.in", "r", stdin);
    freopen("out.out", "w", stdout);
#endif 
    int n; scanf("%d", &n);
    ll x = 1;
    for(int i = 2; i <= n; ++i){
        ll gcd = __gcd(x, 1ll * i);
        ll m = i / gcd;
        x *= m;
    }
    cout << x + 1 << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll Mod = 998244353;
const int MAX = 510000;
const double PI = 3.14159265358979;
const vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};

// 最大公約数
ll gcd(ll m, ll n) {
  if (n==0) return abs(m);
  else return gcd(n, m%n);
}

// 最小公倍数
ll lcm(ll m, ll n) {
  return abs(m)/gcd(m, n)*abs(n);
}

int main() {
  ll N;
  cin >> N;
  if (N==2) cout << 3 << endl;
  else {
    ll res = lcm(2, 3);
    for (int i=4; i<=N; i++) res = lcm(res, i);
    res++;
    cout << res << endl;
  }
  return 0;
}