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 SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    l = []
    for p in range(2, n):
        if prime[p]:
            l.append(p)
    return l


def prime_factors(n):
    dic = {}
    count = 0
    while n % 2 == 0 and n != 0:
        count += 1
        n >>= 1
    if count > 0:
        dic[2] = count
    for i in range(3, int(n ** 0.5) + 1, 2):
        count = 0
        while n % i == 0 and n != 0:
            n //= i
            count += 1
        if count > 0:
            dic[i] = count
    if n > 2:
        dic[n] = 1
    return dic


if __name__ == '__main__':
    n = int(input().strip())
    if n <= 2:
        print(n)
    else:
        ans = n * (n - 1)
        pf = prime_factors(ans)
        sieve = SieveOfEratosthenes(n)[::-1]
        found = False
        for x in sieve:
            if x not in pf:
                print(ans * x)
                found = True
                break
        if not found:
            primes = pf.keys()
            ma = 0
            for prime in primes:
                st = prime ** pf[prime]
                count = 0
                while st * prime < n:
                    count += 1
                    st = st * prime
                ma = max(ma, prime ** count)
            print(ans * ma)
