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 sys
import math
from sys import stdin, stdout
 
# gcd of two numbers
def gcd(a, b):
    if a < b:
        return gcd(b, a)
    if b == 0:
        return a
    return gcd(b, a % b)
 
# TAKE INPUT
def get_ints_in_variables():
    return map(int, sys.stdin.readline().strip().split())
def get_int(): return int(input())
def get_ints_in_list(): return list(
    map(int, sys.stdin.readline().strip().split()))
def get_list_of_list(n): return [list(
    map(int, sys.stdin.readline().strip().split())) for _ in range(n)]
def get_string(): return sys.stdin.readline().strip()
 
def main():
    # Write Your Code Here
    n = int(input())
    if n <= 2:
        print(n)
        return
    else:
        first = n
        mx = 0
        while first > 2:
            second = first-1
            third = first-2
            while gcd(first,second) != 1:
                second -= 1
            while third > 0:
                if gcd(first, third) == 1 and gcd(second, third) == 1:
                    res = first*second*third
                    mx = max(mx, res)
                    break
                third -= 1
            first -= 1
        print(mx)
#  calling main Function
if __name__ == "__main__":
    main()