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=50000
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
def dfs(n,dep):
    if n==1:
        return 1
    ans=10**3000
    for d in range(2,n+1):
        if n%d==0:
            ans=min(ans,dfs(n//d,dep+1)*(pri[dep]**(d-1)))
    return ans
print(dfs(n,1))
