#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
using Graph = vector<vector<int> >;

#define INF 1e9
#define LLINF 1e18
#define PI 3.14159265358979323
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;

template<class T> void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}

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

ll lcm(ll x,ll y){
    return ll(x / gcd(x, y)) * y;
}


int main() {
    ll n, ans = 1;
    cin >> n;
    for (int i = 2; i <= n; i++) {
        ans = lcm(ans, i);
    }
    cout << ans + 1 << endl;
}
#include <iostream>
using namespace std;
using ll = long long int;

int main(){
    ll n;
    cin >> n;
    ll ac = 0;
    ll wa = n+1;
    while(wa-ac > 1){
        ll mid = (ac+wa)/2;
        if(mid <= (2LL*(n+1))/(mid+1)) ac = mid;
        else wa = mid;
    }
    cout << n+1-ac << endl;
    return 0;
}