#include <iostream>
#pragma GCC optimize("O3")
#define int unsigned long long
using namespace std;

bool check(int n,int x){
    if(x%n!=1)return 1;
    return 0;
}

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

signed main(){
    int n;
    cin>>n;
    int sum=1;
    for(int i=2;i<=n;i++){
        if(sum%i==0)continue;
        int k=gcd(sum,i);
        sum=sum/k*i;
    }
    cout<<sum+1<<'\n';
}


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

typedef long long int ll;
#define deb(x) cout << #x << " " << x << endl;
#define debtwo(x,y) cout << x << ", " << y << endl;
#define mod 1000000007
#define N 1000001

void solve() {
	ll n; cin >> n;

	ll res = 1;
	vector<bool> primes(31, true);

	for (int i = 2; i <= 5; i++) {
		if (primes[i]) {
			for (int j = i * i; j <= 30; j += i) {
				primes[j] = false;
			}
		}
	}

	for (int i = 2; i <= n; i++) {
		if (primes[i]) {
			res = i * res;
			if (i == 3 || i == 5)
				res = i * res;
			if (i == 3)
				res = i * res;
		}
		else if (i == 4) {
			res = i * i * res;
		}
	}

	cout << res + 1 << endl;
}

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

	ll t = 1;
	//cin >> t;

	while (t--) {
		solve();
	}
}