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).
## KALAM
n = int(input())
dp = []
for i in range(n + 1):
    t = []
    for j in range(10):
        t.append(0)
    dp.append(t)
p = [2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 , 23 , 29]
for i in range(10):
    dp[1][i] = 1
for i in range(2 , n + 1):
    dp[i][0] = p[0] ** (i - 1)
    for j in range(1 , 10):
        dp[i][j] = dp[i][j - 1]
        for k in range(2 , i + 1):
            if(k * k > i):
                break
            if(i % k > 0):
                continue
            dp[i][j] = dp[i // k][j - 1] * (p[j] ** (k - 1))
A = dp[n][0]
for i in range(10):
    A = min(A , dp[n][i])
print(A)
