#include<bits/stdc++.h>
#define ls(p) p<<1
#define rs(p) p<<1|1
#define de(x) cout<<#x<<" = "<<x<<endl;
#define rep(i,a,b) for(int i = (a);i<=(b);++i)
#define endl '\n'
#define PI acos(-1.0)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 1e5+10;
const int INF = 1e9+10;

int main(){
 ll x = 1;
 x = x*5*7*11*13*15*16*17*18*19*23*29;
 ++x;
	cout<<x<<endl;
}
/*
10 acesxd




*/
#include<bits/stdc++.h>
using namespace std;
long long gcd(long long int a, long long int b)
{
  if (b == 0)
    return a;
  return gcd(b, a % b);
}
long long lcm(int a, int b)
{
    return (a / gcd(a, b)) * b;
}
int main(){
    long long int n;
    cin>>n;
    long long ans = 1;
    for(long long int i=2;i<=n;i++){
        ans = lcm(ans,i);
    }
    cout<<ans+1<<endl;
}