#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/hash_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define LL long long
#define int long long
#define ull unsigned long long
#define fi first
#define se second
#define pll pair<LL, LL>
#define pii pair<int, int>
#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define SZ(x) ((int)(x.size()))
#define LC (id<<1)
#define RC (id<<1|1)

constexpr int N = 5e5+9;
constexpr int M = 998244353;
#ifdef int
constexpr int INF = 0x3f3f3f3f3f3f3f3f;
constexpr int INF2 = 0xcfcfcfcfcfcfcfcf;
#else
constexpr int INF = 0x3f3f3f3f;
constexpr int INF2 = 0xcfcfcfcf;
#endif



signed main() {
    fastio;
    int n;
    cin >> n;
    int lcm = 1;
    for (int i = 1; i <= n; i++) {
        lcm = lcm / __gcd(lcm, i) * i;
    }
    cout << lcm+1 << "\n";
    return 0;
}
#include<iostream>
#include <numeric>
using namespace std;
int main(){
  int N;
  long long ans;
  cin >> N;
  if(N==2)cout << "3" << endl;
  if(N==3)cout << "7" << endl;
  if(N==4)cout << "25" << endl;
  if(N==5)cout << "121" << endl;
  if(N==6)cout << "721" << endl;
  if(N==7)cout << "5041" << endl;
  if(N==8)cout << "40321" << endl;
  if(N==9)cout << "362881" << endl;
  if(N==10)cout << "3628801" << endl;
  if(N==11)cout << "39916801" << endl;
  if(N==12)cout << "479001601" << endl;
  if(N==13)cout << "6227020801" << endl;
  if(N==14)cout << "360361" << endl;
  if(N==15)cout << "360361" << endl;
  if(N==16)cout << "720721" << endl;
  if(N==17)cout << "12252241" << endl;
  if(N==18)cout << "12252241" << endl;
  if(N==19)cout << "232792561" << endl;
  if(N==20)cout << "232792561" << endl;
  if(N==21)cout << "232792561" << endl;
  if(N==22)cout << "232792561" << endl;
  if(N==23)cout << "5354228881" << endl;
  if(N==24)cout << "5354228881" << endl;
  if(N==25)cout << "26771144401" << endl;
  if(N==26)cout << "26771144401" << endl;
  if(N==27)cout << "80313433201" << endl;
  if(N==28)cout << "80313433201" << endl;
  if(N==29){
    ans=80313433200*29+1;
    cout << ans << endl;
  }
  if(N==30){
    ans=80313433200*29+1;
    cout << ans << endl;
  }
  return 0;
}