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.
# This code is contributed by Siddharth


from sys import *
input = stdin.readline



import threading
from bisect import *
import math
from collections import *
import operator
from heapq import *
from itertools import *
inf=10**19
mod=10**9+7
MOD=998244353
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
drow = [0, 1, 0, -1]
dcol = [-1, 0, 1, 0]
# inverse modulo power pow(a,-1,mod) - it only works on py 3.8 ( *not in pypy )
setrecursionlimit(200005)
def asc(c):
    return ord(c)-97+1




# ==========================================> Code Starts Here <=====================================================================)



sieve=[0]*(10**6+5)
sieve[0]=sieve[1]=1
i=2
while i*i<=10**6+5:
    if sieve[i]:
        i+=1
        continue
    j=i*i
    while j<10**6+5:
        sieve[j]=1
        j+=i
    i+=1
prime=[i for i in range(10**6+5) if not sieve[i]]
n=int(input())
ans=n*(n-1)
ind=bisect_left(prime,n-2)
if prime[ind]==n-2:
    ans*=(n-2)
else:
    ind-=1
    ans*=prime[ind]
print(ans)