Given the number n, find the smallest positive integer which has exactly n divisors. It is guaranteed that for the given n the answer will not exceed 1018.

Input

The first line of the input contains integer n (1 ≤ n ≤ 1000).

Output

Output the smallest positive integer with exactly n divisors.

Examples

Input

4


Output

6


Input

6


Output

12
def delit(a) :
    res = []
    i = 1
    while i * i < a + 1 :
        if a % i == 0 :
            temp = [i, a // i]
            res.append(temp)
        i += 1
    return res 
    
n = int(input())
npr = [2,3,5,7,11,13,17,19,23,29]
fact = delit(n)
flen = len(fact)
while True :
    for j in range(flen) :
        zero = 1
        if not (1 in fact[j]) :
            zero = 0
            n1 = list(fact[j])
            factj = delit(n1.pop())
            for k in range(len(factj)) :
                factj[k].extend(n1)
                factj[k].sort()
                fact.append(factj[k])
    flen = len(fact)
    if zero == 1:
        break
for ik in fact :
    ik.sort(reverse=True)
    if ik[-1] == 1 :
        ik.pop()
j =[0]
resj = []
for i in fact :
    if i != j :
        resj.append(i)
    j=i
minc = int(1e18)
for i in resj :
    j = 0
    ss = 1
    for ii in i:
        ss *= npr[j] ** (ii-1)
        if ss > int(1e18) :
            ss = int(1e18) + 1
            break
        j += 1
    minc = min(minc,ss)
print(minc)
