//雪花飄飄北風嘯嘯
//天地一片蒼茫

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
//change less to less_equal for non distinct pbds, but erase will bug

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin.exceptions(ios::badbit | ios::failbit);
	
	ll ans=16LL*27*25*7*11*13*17*19*23*29+1;
	cout<<ans<<endl;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#define int long long
#define loop(x) for (int i = 0; i < (int)(x); i++)
#define loop2(x) for (int j = 0; j < (int)(x); j++)
#define endl '\n'
using namespace std;
// vector<int> sieve;
// void sieveoferathostene()
// {
//     int x = 1000;
//     vector<bool> n(x);
//     loop(n.size()) for (int i = 2; i <= x; i++)
//     {
//         if (!n[i])
//         {
//             int p = i * 2;
//             for (; p <= x; p += i)
//             {
//                 n[p] = true;
//             }
//         }
//     }
//     for (int i = 2; i <= n.size(); i++)
//     {
//         if (!n[i])
//         {
//             sieve.push_back(i);
//         }
//     }
// }

    int gcd(int a, int b) {
   if (b == 0)
   return a;
   return gcd(b, a % b);
}

int lcm(int x,int y){
    return (x*y)/gcd(x,y);
}
signed main()
{
    std::cin.tie(0);
    std::cout.tie(0);

    ios::sync_with_stdio(false);
    
    int n; cin>>n;
    int ans = 1;
    if(n==2){
        cout<<3<<endl;
    }else{
    for(signed i = 2;i<n;i++){
        ans = lcm(ans,lcm(i,i+1));
    }
    cout<<ans+1<<endl;
    }
}
