#include<bits/stdc++.h>

using namespace std;
#define ll long long
ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
ll lcm(ll a,ll  b)
{
    return a/gcd(a,b)*b;
}
int main()
{
    ll n;
    cin>>n;
    ll ans=1;
    for(int i=2;i<=n;i++)
        ans=lcm(ans,i);
    cout<<ans+1<<endl;

}

#include <bits/stdc++.h>
using namespace std;
 
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define si(c) ((int)(c).size())
#define forsn(i,s,n) for(int i = (int)(s); i<((int)n); i++)
#define dforsn(i,s,n) for(int i = (int)(n)-1; i>=((int)s); i--)
#define all(c) (c).begin(), (c).end()
#define D(a) cerr << #a << "=" << (a) << endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair
 
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

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

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

    int n; cin >> n;
    ll l = 1;
    for (int x = 2; x <= n; x++) l = lcm(l, x);
    auto ans = l+1;
    for (int x = 2; x <= n; x++) assert(ans%x == 1);
    cout << ans << endl;

    return 0;
}
