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

//Template Begin
#define ll long long
#define int long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define be begin()
#define en end()
#define le length()
#define endl '\n'

using VI=vector<int>;
using VLL=vector<ll>;
using PII=pair<int, int>;
using PLL=pair<ll, ll>;
using VPII = vector< PII >;

#define TC(t) while (t--)
#define REP(i,from,to)      for(auto i=(from); i<=(to); ++i)
#define PER(i,from,to)      for(auto i=(from); i>=(to); --i)
#define REPITER(it, a)		for(__typeof(a.begin()) it = a.begin();it != a.end(); ++it)

#define FOR(i,less_than)    for (auto i=0; i<(less_than); ++i)
#define FORI(i, container)  for (auto i=0; i<(container).size(); ++i)
#define ROFI(i, container)  for (auto i=SZ(container)-1; i>=0; --i)

#define FOREACH(elem, container)  for (auto &elem : (container))
#define MEMSET(container, value)  memset(container, value, sizeof(container))
#define MEMSET0(container)        memset(container, 0, sizeof(container))
#define FILL(container, value)    fill(container.begin(), container.end(), value)
#define FILL0(container)    	  fill(container.begin(), container.end(), 0)
#define ALL(container)            (container).begin(), (container).end()
#define SZ(container)             (int)((container).size())
#define POP(var, container) auto var=(container.front()); container.pop();

const int MOD = 1e9 + 7;
const int INF = 1e9;

template<typename T> T abs(T a) { return a < 0 ? -a : a; }
//Template End

int a[32]={0};
void calc() {
	a[0]=1;
	REP(i, 1, 32) a[i] = (a[i-1]*i)/__gcd((long long)i, a[i-1]);
}
void solve() {
	int n;
	cin>>n;
	cout<<a[n]+1<<endl;
}

signed main() {
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output1.txt", "w", stdout);
    #endif
    
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	// your code goes here
	int t=1;
	// cin>>t;
	calc();
	TC(t) solve();
	return 0;
}
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
ll mod = 1000000007;
const double PI = 3.141592653589793238460;
const int INF = 1e9+5;
const ll lINF = 1e16+1;

int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    
    vector<ll> isprime = {2,3,5,7,11,13,17,19,23,29};

    ll ans = 1;
    ans*=16;
    ans*=27;
    ans*=25;
    ans*=7;
    ans*=11;
    ans*=29;
    ans*=23;
    ans*=19;
    ans*=13;
    ans*=17;
    ans++;
    // for(int i=2; i<=n; i++){
    //     cout<<(ans)%i<<' ';
    // }
    // cout<<endl;
    cout<<ans;

    return 0;
}