Some days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it.

But I also don't want to use many numbers, so I'll choose three positive integers (they don't have to be distinct) which are not greater than *n*. Can you help me to find the maximum possible least common multiple of these three integers?
The first line contains an integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>) — the *n* mentioned in the statement.
# include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll >pll;

const ll maxN = ll(8e5);
const ll smaxN = ll(5e3);
const ll mmaxN = ll(3e4);
const ll lmaxN = ll(3e6);
const ll oo = ll(1e18);
const ll MOD = ll(1e9) + 7;
const ld EPS = 1e-10;
const ld PI = acos(0.0) * 2;
const ll LOGMAX = 22;
const ll dx[] = {-1, +0, +0, +1};
const ll dy[] = {+0, -1, +1, +0};

template<typename T>
T Sqr(T x) {
    return x * x;
}

template<class T>
ll Sz(T x) {
    return ll(x.size());
}

inline ll MultMod(ll a, ll b, ll mod) {
    if(b == 0)
        return 0;
    if(b % 2)
        return (MultMod(a, b - 1, mod) + a) % mod;
    return (MultMod(a, b / 2, mod) * 2) % mod;
}

inline ll ModPow(ll a, ll b, ll mod) {
    if(b == 0)
        return 1;
    if(b == 1)
        return a;
    if(b % 2)
        return (ModPow(a, b - 1, mod) * a) % mod;
    ll z = ModPow(a, b / 2, mod);
    return (z * z) % mod;
}

inline bool Prime(ll x){
    if(x < 2)
        return 0;
    for(ll i = 2; i * i <= x; ++i) {
        if(x % i == 0)
            return 0;
    }
    return 1;
}

inline bool IsProbablePrime(ll x) {
    return 1; // -> returns 1
}

ll n, ans;

ll __lcm(ll a, ll b){
    return a * b / __gcd(a, b);
}

int main(){
    scanf("%lld", &n);
    if(n == 1){
        printf("%lld", 1ll);
    }
    else if(n == 2){
        printf("%lld", 2ll);
    }
    else if(n == 3){
        printf("%lld", 6ll);
    }
    else{
        for(ll i = max(1LL, n - ll(1e5)); i + 2 <= n; ++i)
            ans = max(ans, __lcm(i, __lcm(i + 1, i + 2)));
        printf("%lld", ans);
    }
    return 0;
}
