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).
import sys
input = sys.stdin.readline

def divisor(i):
    s = []
    for j in range(1, int(i ** (1 / 2)) + 1):
        if i % j == 0:
            s.append(i // j)
            s.append(j)
    return sorted(set(s))

def the_sieve_of_eratosthenes(n):
    s = [1] * (n + 1)
    x = []
    for i in range(2, n + 1):
        if s[i]:
            x.append(i)
            for j in range(i, n + 1, i):
                s[j] = 0
    return x

n = int(input())
d = divisor(n)
x = the_sieve_of_eratosthenes(1000)
m = len(d)
inf = pow(10, 18) + 1
dp = [inf] * m
dp[0] = 1
for i in range(m):
    p = x[i]
    for j in range(m - 2, -1, -1):
        if not dp[j] ^ inf:
            continue
        dj = d[j]
        dpj = dp[j]
        for k in range(j + 1, m):
            if d[k] % dj:
                continue
            l = d[k] // dj
            dp[k] = min(dp[k], dpj * pow(p, l - 1))
ans = dp[-1]
print(ans)