#include<bits/stdc++.h>
// Program showing a policy-based data structure.
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
using namespace std;
using namespace __gnu_pbds;
typedef       long long int      ll;
// GNU link : https://goo.gl/WVDL6g
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;
#define       READ               freopen("in.txt", "r", stdin);
#define       WRITE              freopen("out.txt", "w", stdout);
#define       optimize           ios::sync_with_stdio(0);cin.tie(0);
#define       RESET(a, b)        memset(a, b, sizeof(a))
#define       gcd(a, b)          __gcd(a, b)
#define       MX                 300005
#define       MOD                1000000007
#define       inf                ll(1e18)
#define       PI                 acos(-1.0)
#define       eps                1e-9
ll LCM(ll a, ll b)
{
   return (a / __gcd(a, b)) * b;
}
int main(void)
{
   optimize
   ll n,x;
   cin>>n;
   ll lcm=1;
   for(ll j=2;j<=30;j++)
   {
      lcm=LCM(lcm,j);
   }
   lcm++;
   cout<<lcm<<endl;
   return 0;
}

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

typedef long long ll;

int main()
{
    ll n;
    cin>>n;
    if(n==30)
        n--;
    ll ans=1;
    for(ll i=n;i>=2;i--)
    {
        if(ans%i!=0){
            ans*=i;
        }
    }
    cout<<ans+1;
}

// 23 4 5 