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.
def prime(x):
    a=[]
    b=1
    while b <= (x-1)//2:
        if x-(x//(2*b + 1))*(2*b + 1) == 0:
            a.append(2*b + 1)
            x = x//(2*b + 1)
            b = 1
            continue
        else:
            b += 1
    return a


def sol():
    n = int(input())
    if n -(n//2)*2 != 0:
        print(n*(n-1)*(n-2))
    else:
        k=1
        while 3 <= 2*k +1 <= (n+2)//2 + 1:
            g = 0
            f = 0
            for x in prime(2*k+1):
                if n-(n//x)*x == 0:
                    g = 1
                    break
            if g == 1:
                k += 1
                continue
            for x in prime(2*k):
                if (n - 1) - ((n -1) // x)*x == 0:
                    f = 1
                    break
            if f == 1:
                k += 1
                continue
            print(n*(n-1)*(n-2*k-1))
            break
        if f==1 or g==1:
            print(n*(n-1)*(n-2)//2)


sol()
