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 = A.copy()
if len(B) > 1:
    B.append(B[0] * B[1])
    B.remove(B[0])
    B.remove(B[0])

r1 = 1

i = 2
while len(A) != 0:
    if (f(i)):
        r1 *= i ** (A[len(A) - 1] - 1)
        A.remove(A[len(A) - 1])
    i += 1
j = 2
r2 = 1
while len(B) != 0:
    if (f(j)):
        r2 *= j ** (B[len(B) - 1] - 1)
        B.remove(B[len(B) - 1])
    j += 1
print(min(r1, r2))