#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long LL;

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

LL LCM(LL a,LL b)
{
	return a/gcd(a,b)*b;
}

int main()
{
    ios::sync_with_stdio(false);

	int n;
	
	cin>>n;
	
	LL lcm=1;
	for(int i=2;i<=n;i++) lcm=LCM(lcm,i);

	cout<<lcm+1<<endl;
	
    return 0;
}

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

int N;

bool isPrime(int n) {
	for(int i = n-1; i > 1; i--) {
		if(n % i == 0) return false;
	}
	return true;
}

int main() {
	cin >> N;

	long long x = 1;

	for(int i = 2; i <= N; i++) {
		if(isPrime(i)) {
			int p = i;
			while(p <= N) {
				x *= i;
				p *= i;
			}
		}
	}
	cout << (x + 1) << endl;
}