#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;


template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
long long mod= 1000000007;

vector<pair<int, int> > prime_factorize(int N) {
    vector<pair<int, int> > res;
    for (int a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        int ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main(){
    int N;
    cin >> N;
    unsigned long long ans = 1;
    int prime[] = {2,3,5,7,11,13,17,19,23,29};

    unordered_map<int, int> um;

    for(int i=2; i <=N; ++i){
        vector<pair<int, int> > v = prime_factorize(i);
        for(int j=0; j<v.size(); ++j){
            pair<int, int> p = v[j];
            int prime = p.first;
            int num = p.second;
            if(um.find(prime) == um.end()){
                um[prime] = num;
            }
            else{
                if(um[prime] < num){
                    um[prime] = num;
                }
            }
            
        }
    }

    for(auto a:um){
        for(int i=0; i<a.second; ++i){
            ans *= a.first;
        }
    }
    ans +=1;

    cout << ans << endl;
    return 0;

}
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define bg begin()
#define en end()
#define endl "\n"
#define vvl(n,m) vector<vector<ll> > a( n , vector<ll> (m))
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define mod 1000000007
using namespace std;
ll power(ll x, ll y, ll m) 
{ 
    if (y == 0) 
        return 1; 
    ll p = power(x, y / 2, m) % m; 
    p = (p * p) % m; 
  
    return (y % 2 == 0) ? p : (x * p) % m; 
} 
ll modInverse(ll a, ll m) 
{ 
    return power(a, m - 2, m); 
}
ll knapsack(vector<vector<ll>>&dp,ll x,ll i,ll n,ll s[],ll h[]){
    ll r,l;
    if(i>=n || x==0)
        return 0;
    if(dp[i][x]!=-1)
        return dp[i][x];
    if(x>=h[i]){
        l=s[i]+knapsack(dp,x-h[i],i+1,n,s,h);
        r=knapsack(dp,x,i+1,n,s,h);
        return dp[i][x]=max(l,r);
    }
    else
        return dp[i][x]=knapsack(dp,x,i+1,n,s,h);
}
void solve()
{
    ll r=1;
    r*=16*27*25*7*11*13;
    r*=(17*19*23*29);
    r++;
    cout<<r;
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast
    solve();
    #ifndef ONLINE_JUDGE
    cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
    return 0;
}