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).
def isPrime(i) -> bool:

    return i > 1

MAX_ANS = 10 ** 18
d = int(input())
bound = 50
p = [-1]
for i in range(100000):
    if(isPrime(i)):
        p.append(i)
        if len(p) > bound:
            break

dp = [[MAX_ANS + 1]*(1 + bound) for _ in range(1 + d)]
for i in range(1 + bound):
    dp[1][i] = 1

for i in range(2, 1 + d):
    for k in range(1, 1 + bound):
        dp[i][k] = dp[1][k - 1] * p[k]**(i - 1)
    t = 2
    while(t * t <= i):
        for k in range(1, 1 + bound):
            dp[i][k] = min(dp[i][k], dp[i//t][k - 1] * p[k]**(t - 1), dp[t][k - 1] * p[k]**(i//t - 1))
        t += 1
print(min(dp[d]))
       




