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())
L=[2,3,5,7,11,13,17,19,23,29]
tab = []
inf = 10**18
FT=[list() for i in range(1200)]
for i in range(1,1000):
    for j in range(i*2,1200,i):
        FT[j].append(i)
#print(FT[1000])
for i in range(1500):
    tab.append([inf]*10)
tab[1][0]=1
for i in range(2,n+1):
    if n%i==0:
        if i<100:tab[i][0]=min(inf,pow(2,i-1))
        for q in FT[i]:
            for x in range(1,10):
                tab[i][x]=min(tab[i][x],pow(L[x],q-1)*tab[i//q][x-1])
print(min(tab[n]))