#include <bits/stdc++.h>

using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define fp(i,a,b) for(int i=a ; i<b ; i++)
#define fn(i,a,b) for(int i=a ; i>=b ; i--)
#define ones(x) __builtin_popcount(x)
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const int M=1e6+5;
const int inf=1e9;
const int mod=1e9+7;

void go(){
	int n; cin >> n;
	ll r = 16LL*27LL*25LL*7LL*11LL*13LL*17LL*19LL*23LL*29LL;
	cout << r+1 << "\n";
}

int main(){	

	fastio;
	int tst=1;
	//cin >> tst;
	while (tst--) go();

	return 0;
}
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define long long long 
int main() {
    long int n;
    cin>>n;
    long int ans=1LL;
    for(long int i=2;i<=n;i++)
    {
        long int temp = __gcd(ans,i);
        ans*=(i/temp);
    }
    cout<<ans+1LL<<endl;
	// your code goes here
	return 0;
}
