#include <bits/stdc++.h>  
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#define for0(i, n) for (int i = 0; i < (int)(n); ++i) 
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) 
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) 
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) 
#define forrc(i,r,l) for (int i= (int)(r); i>= (int)(l); --i)

#define pb push_back
#define fi first
#define se second
#define mp make_pair

#define all(x) (x).begin(), (x).end() 
#define rall(x) (x).rbegin, (x).rend() 


#define tr(c,i) for(_typeof_((c)).begin() i = (c).begin(); i != (c).end(); i++)


#define present(c,x) ((c).find(x) != (c).end())


#define cpresent(c,x) (find(all(c),x) != (c).end())

#define sz(a) int((a).size())

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

using namespace std;
#define count1(x) __builtin_popcount(x)
#define count1ll(x) __builtin_popcountll(x)
#define leadzero(x) __builtin_clz(x)
#define trailzero(x) __builtin_ctz(x)


typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;
typedef long long ll;
typedef unsigned long long int ull;
/*
//unhackable unordered_map and gp_hash_table:-
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

*/

ll max(ll a,ll b){
    if(a>b) return a;
    else return b;
}

const int MOD=1000000007;
int no_of_bits(long long n)
{
    int count=0;
    while(n>0)
    {
        n=n>>1;
        count++;
    }
    return count;
}
long long gcd(long long a, long long b) {
  while (b > 0) {
    long long t = a % b;
    a = b;
    b = t;
  }
  return a;
}

void add_self(int &a, int b){
  a+=b;
  if(a>=MOD){
    a-=MOD;
  }
}

void sub_self(int &a, int b){
  a-=b;
  if(a<0){
    a+=MOD;
  }
}

int search(vi x,int n,int i){
  int l=0,h=n-1,mid;
  while(l<=h){
    mid=(l+h)/2;
    if(x[mid]<i){
      l=mid+1;
    }else{
      h=mid-1;
    }
  }
  return l;
}

const int INF=-2000;
const ll INF_=1e13;
ll minll(ll a,ll b){
    if(a>b) return b;
    else return a;
}
ll maxll(ll a,ll b){
    if(a<b) return b;
    else return a;
}
void solve(){
    ll ans=1;
    for(int i=1;i<=30;i++)
    {
        ans=i*ans/gcd(i,ans);
    }
    cout<<ans+1<<'\n';
}
int main(){
    
//  auto start = chrono::high_resolution_clock::now(); 
  
    // unsync the I/O of C and C++. 
    // ios_base::sync_with_stdio(false); 
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  int t;
//   cin>>t;
t=1;
  while(t--){
      solve();
  }
    
  
    // auto end = chrono::high_resolution_clock::now(); 
  
    // Calculating total time taken by the program. 
    // double time_taken =  
    //   chrono::duration_cast<chrono::nanoseconds>(end - start).count(); 
  
    // time_taken *= 1e-9; 
  
    // cout << "Time taken by program is : " << fixed  
        //  << time_taken << setprecision(9); 
  
}
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define all(x) x.begin(),x.end()
#define y1 omg
#define INF 1000000010
#define FOR(x, n) for(int x=0; x<n; x++)
#define ini(x, n) memset(x, n, sizeof(x));
#define MOD ((int)1e9 + 7)
#define atoi(x) ((x)-'0')
#define int ll
//#define double long double
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;

int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, 1, -1, 1, -1 };

ll n, ans = 1;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

signed main() {
	cin >> n;
	if (n == 1) {
		cout << 1;
	}
	else {
		for (int i = 1; i <= n; i++) ans = lcm(ans, i);
		cout << ans + 1;
	}
}

