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 f(n):
    for i in range(2, n):
        if n % i == 0:
            return False
    return True


n = int(input())
c = n
A = []
while n > 1:
    for i in range(2, int(n + 1)):
        if (n % i == 0) & (f(i)):
            A.append(i)
            n /= i

B = []
B.append(A.copy())
while len(A) > 1:
    A.append(A[0] * A[1])
    A.remove(A[0])
    A.remove(A[0])
    B.append(A.copy())

m = 1000000000000000000000000000

for el in B:
    i = 2
    r1 = 1
    while len(el) != 0:
        if (f(i)):
            r1 *= i ** (el[len(el) - 1] - 1)
            el.remove(el[len(el) - 1])
        i += 1
    if (m > r1):
        m = r1

print(m)
