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).
a=[0]*50010
v=[0]*50010
pri=[0]*50010
tot=0
n=int(input())
for i in range(2,n+1):
    if not v[i]:
        tot+=1
        pri[tot]=i
    for j in range(1,tot+1):
        if i*pri[j]>n:
            break
        v[i*pri[j]]=1
        if i%pri[j]==0:
            break
ans=10**1000
def dfs(dep,tmp,num,up):
    global ans
    if num>n or dep>=18:
        return
    if num==n and ans>tmp:
        ans=tmp
        return
    for i in range(1,up+1):
        if tmp*pri[dep]>ans:
            break
        tmp*=pri[dep]
        dfs(dep+1,tmp,num*(i+1),up+1)
    return
dfs(1,1,1,64)
print(ans)
