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.
import queue
from math import inf, gcd, floor, sqrt, ceil, log, log2, log10
import sys
from collections import *
from random import *
from itertools import *

sys.setrecursionlimit(99999)
eps = sys.float_info.epsilon
P = 2
INF = 1e9 + 1
MOD = 1000000007


def is_prime(n):
    if n == 0 or n == 1:
        return False
    d = 2
    while d * d <= n:
        if n % d == 0:
            return False
        d += 1
    return True


def div_up(n, k):
    if n % k == 0:
        return n // k
    else:
        return n // k + 1


def num_len(n, base = 10):
    if n == 0:
        return 1
    return int(floor(log(n, base) + 1))


def dfs_sample(graph, cl, p, v):
    cl[v] = 1
    for to in graph[v]:
        if cl[to] == 1 and p[v] != to:
            # yay, cycle
            pass
        elif cl[to] == 0:
            p[to] = v
            dfs_sample(graph, cl, p, to)
    cl[v] = 2


def down(a):
    for i in range(1, len(a)):
        if a[i] > a[i - 1]:
            return False
    return True


def up(a):
    for i in range(1, len(a)):
        if a[i] < a[i - 1]:
            return False
    return True


def code(c):
    return ord(c) - 32


def _hash_(s):
    res, p = 0, 1
    for i in range(len(s)):
        res += (code(s[i]) * p)
        res %= MOD
        p *= P
        p %= MOD
    return res % MOD


def remove_edge(v, u, graph):
    graph[v].remove(u)
    graph[u].remove(v)


b = True
def dfs_stack(start, graph, visited, flags):
    global b
    stack = []
    visited[start] = True
    stack.append(start)
    while len(stack) != 0:
        v = stack.pop()
        if not flags[v]:
            b = False
        for to in graph[v]:
            if not visited[to]:
                visited[to] = True
                stack.append(to)


def all_eq(a):
    for i in range(len(a) - 1):
        if a[i] != a[i + 1]:
            return False
    return True


def kmp(s, pr):
    n = len(s)
    pr[0] = 0
    for i in range(1, n):
        j = pr[i - 1]
        while j > 0 and s[i] != s[j]:
            j = pr[j - 1]
        if s[i] == s[j]:
            j += 1
        pr[i] = j


def lcm(a, b):
    return a * b // gcd(a, b)


def solve():
    n = int(input())
    if n == 1:
        print(1)
    elif n == 2:
        print(2)
    else:
        if n % 2 != 0:
            print(lcm(lcm(n, n - 1), n - 2))
        else:
            print(max(lcm(lcm(n, n - 1), n - 2), lcm(lcm(n - 1, n - 2), n - 3)))


#for _ in range(int(input())):
solve()


def debug():
    pass


# debug()