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>
#define fast_cin ios_base::sync_with_stdio(0);\
                    cin.tie(0);
#define all(x) x.begin(), x.end()
#define isz(x) (int)x.size()
#define CF(x) int x;cin >> x;while(x--)
 
using namespace std;
 
// using
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vld = vector<ld>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using pill = pair<int, ll>;
using vpill = vector<pair<int, ll>>;
using vvpill = vector<vpill>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
 
template <typename T>
istream& operator >> (istream& in, vector<T>& v){
    for (T& el : v) in >> el;
    return in;
}
 
template <typename T>
ostream& operator << (ostream& out, const vector<T>& v){
    for (const T& el : v) out << el << ' ';
    return out;
}
 
 
template <typename T, typename U>
istream& operator >> (istream& in, pair<T, U>& p){
    in >> p.first >> p.second;
    return in;
}
 
template <typename T, typename U>
ostream& operator << (ostream& out, pair<T, U>& p){
    out << p.first << ' ' << p.second;
    return out;
}
 
/*
┼┼┼┼┼┼┼████
┼┼┼┼┼┼██████
┼┼┼┼┼████████
┼┼┼┼┼████████
┼┼┼┼┼█████░░░
┼┼┼┼┼████░░░░░░
┼┼┼┼┼┼██░░░░░░░░░
┼┼┼┼┼┼┼░░░░░░░░░░░
┼┼┼┼┼┼░░░░░░░░░░███
┼┼┼┼┼┼░░░░░░░░░█████▒▒▒
┼┼┼┼┼░░░░░░░███████▒▒▒▒▒
┼▒▒▒█░░░░░████████▒▒░░░▒▒
▒▒▒▒██████████████▒░░░░░▒
▒▒░░████████████▒▒▒▒░░░░▒
▒░░░█████████▒▒▒▒▒▒▒▒░░▒▒
▒░░░▒██████▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒░▒▒▒▒▒░░▒▒▒▒░░▒▒▒▒▒▒▒
┼▒▒▒▒▒▒░██▒▒▒▒██░▒▒▒▒
┼┼┼▒▒▒▒░██▒▒▒▒██░▒▒▒▒
┼┼┼▒▒▒▒▒▒▒░██░▒▒▒▒▒▒▒
┼┼┼▒▒▒▒▒▒░░██░░▒▒▒▒▒▒
┼┼┼┼▒▒▒▒░░░░░░░░▒▒▒▒
┼┼┼┼▒▒▒▒░░░░░░░░▒▒▒▒
┼┼┼┼┼▒▒▒░░░██░░░▒▒▒
┼┼┼┼┼┼▒▒▒░░░░░░▒▒▒
┼┼┼┼██░░▒▒▒▒▒▒▒▒░░██
┼┼███░░░████████░░░███
┼████░░██████████░░████
┼████░░░░░░░░░░░░░░████
*/


int main(){
    fast_cin;
    ll n;
    cin >> n;
    if (n == 1){
        cout << 1;
        return 0;
    }
    else if (n == 2){
        cout << 2;
        return 0;
    }
    else if (n == 3){
        cout << 6;
        return 0;
    }
    if (n & 1){
        cout << n * (n - 1) * (n - 2);
    }
    else {
        ll mx = 0;
        for (ll a = n; a >= max(n - 50, 1); --a){
            for (ll b = a - 1; b >= max(n - 50, 1); --b){
                for (ll c = b - 1; c >= max(n - 50, 1); --c){
                    ll h = a * b / __gcd(a, b);
                    ll res = h * c / __gcd(h, c);
                    mx = max(mx, res);
                }
            }
            
        }
        cout << mx << '\n';
    }
    return 0;
}
