#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const long long MOD = 1000000007;

long long gcd(long long a, long long b){
    while (a != 0 && b != 0){
        if (a >= b) a %= b;
        else b %= a;
    }
    return a + b;
}

long long lcm(long long a, long long b){
    return (a / gcd(a, b)) * b;
}

signed main(){
    ll N;
    cin >> N;
    ll L = 1;
    for(ll i = 2; i <= N; i++) L = lcm(L, i);
    PRINT(L + 1);
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define ls rt<<1
#define rs rt<<1|1
const int N=1e2+5;
const int INF=0x3f3f3f3f;
const int mod=1e4+7;
const double eps=1e-9;
const double pi=acos(-1);
bool chk[N];
int cnt,p[N];
void prework(ll &ans){
    chk[1]=1;
    for(int i=2;i<N;++i){
        if(!chk[i]) p[cnt++]=i;
        for(int j=0;j<cnt&&i*p[j]<N;++j){
            chk[i*p[j]]=1;
            if(i%p[j]==0) break;
        }
    }
    ans=1;
    for(int i=0;i<cnt;++i){
        if(p[i]>30) break;
        ans*=p[i];
    }
    ans=ans*9*8*5+1;
}
int main(){
    ll ans;
    prework(ans);
    int n;scanf("%d",&n);
    printf("%lld\n",ans);
    return 0;
}