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
A.sort()
B = A.copy()
first = B[0]
B[1] = first * B[1]
B.remove(first)
B.sort()
a = 2
r1 = 1
while len(A) != 0:
    if f(a):
        last = A[len(A) - 1]
        r1 *= a ** (last - 1)
        A.remove(last)
    a += 1
b = 2
r2 = 1
while len(B) != 0:
    if f(b):
        last = B[len(B) - 1]
        r2 *= b ** (last - 1)
        B.remove(last)
    b += 1
print(min(r1, r2))