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 10<sup class="upper-index">18</sup>.
The first line of the input contains integer *n* (1 ≤ *n* ≤ 1000).
n = int(input())
max_n = 1000000000000000000

primos = [2, 3, 5]

def d(i,j):
    if j < 0:
        return 1
    if i == 0:
        return 1
    res = 1000000000000000000
    for k in range(0,i+1):
        res = min(res,d(int((i/(k+1))),j-1)*primos[j]**k)
    return res

def otro(potencia,pos):
    
    if pos < 0:
        return 1
    primo = primos[pos]
    res = 1000000000000000000
    print(potencia,primo)
    for pot in range(potencia,-1,-1):
        temp = primo**pot
        res = min(res,temp*otro(potencia-pot,pos-1))
    print("-"*10)
    return res



# pos = 0
# primo = primos[pos]
# pot = 3
# lasOtras = 0
# elResto = 1
# numero = primo**pot
# if n == (pot+1)*lasOtras:
#     ans = min(ans,numero*elResto)


def phi(divisores, pos,maxDivisores):
    res = 1000000000000000000
    if pos >= len(primos):
        return 1
    if(divisores == maxDivisores):
        return 1
    if(divisores > maxDivisores):
        return -1 # No sirve ese camino
    for i in range(1,maxDivisores):
        num = primos[pos]**i
        d = divisores*(i+1)
        num *= phi(d,pos+1,maxDivisores)
        # print(num)
        if(num > 0):
            res = min(res,num)
    return res


print(phi(1,0,n))
# print(otro(n-1,len(primos)-1))
