#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){
	return b==0?a:gcd(b,a%b);
}
ll lcm(ll a,ll b){
	return a/gcd(a,b)*b;
}
int n;
ll dp[40];
int main(){
	scanf("%d",&n);
	dp[1]=1;
	for(int i=2;i<=n;i++)
		dp[i]=lcm(dp[i-1],i);
	printf("%lld",dp[n]+1);
	return 0;
}
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x))
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF 1e9
#define INFL 1e18
#define mod 1000000007
//#define mod 998244353
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> os;
typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> os_pair;

ll power(ll x,ll n){ll res =1;while(n>0){if(n%2==1){res=res*x;}x=x*x;n=n/2;}return res;}
ll powm(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

//cout<< fixed << setprecision(10)
//__builtin_popcountll()


int main(){

    fast;
    int n,i,j;
    cin>>n;
    vector<int>v;
    for(i=2;i<=n;i++)
    {
    	int f=0;
    
    	for(j=2;j*j<=i;j++)
    	{
    		if(i%j==0)
    		{
    			f=1;
    			break;
			}
		}
		if(f==0)
		v.pb(i);
	}
	
	ll ans=1;
	for(i=0;i<v.size();i++)
	{
		
		for(j=0;j<10;j++)
		{
			if(power(v[i],j)>n)
			{
				break;
			}
		}
		j--;
		ans=ans*power(v[i],j);
	}
	cout<<ans+1;
    
}