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

typedef long long ll;
ll mod = 1000000007;
const double PI = 3.141592653589793238460;
const int INF = 1e9+5;
const ll lINF = 1e16+1;

int main(){
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    
    vector<ll> isprime = {2,3,5,7,11,13,17,19,23,29};

    ll ans = 1;
    ans*=16;
    ans*=27;
    ans*=25;
    ans*=7;
    ans*=11;
    ans*=29;
    ans*=23;
    ans*=19;
    ans*=13;
    ans*=17;
    ans++;
    // for(int i=2; i<=n; i++){
    //     cout<<(ans)%i<<' ';
    // }
    // cout<<endl;
    cout<<ans;

    return 0;
}
#include <bits/stdc++.h>

using namespace std; 

#define ll long long

ll gcd(ll  a, ll b) {
    return b ? gcd(b, a % b) : a;
}

ll mdc(ll a, ll b) {
    return (a * b) / gcd(a, b);
}

int main() {
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int n; cin >> n;
    ll ans = 2;
    for(int i = 2; i <= n; i++)
        ans = mdc(ans, i);
    cout << ans + 1 << endl;
    return 0;
}
