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 math

n = int(input())

# Compute k = ceil(n/2)
k = math.ceil(n/2)

# Generate the first k primes
primes = []
is_prime = [True] * (2*k)
for i in range(2, 2*k):
    if is_prime[i]:
        primes.append(i)
        for j in range(i**2, 2*k, i):
            is_prime[j] = False

# Compute the product of the first k-1 primes raised to the power 2
num = 1
for i in range(k-1):
    num *= primes[i]**2

# Find thesmallest prime number larger than the k-th prime
p = primes[k-1]
while True:
    factors = [p]
    for i in range(k-1):
        factors.append(primes[i]**2)
    # Compute the number of divisors
    divisors = 1
    for factor in factors:
        divisors *= 1 + factor
    if divisors == n:
        break
    p += 1

# Output the product of all the primes raised to the appropriate powers
ans = 1
for factor in factors:
    ans *= factor
print(ans)
	 		 	 			  	 	  	 	    			 		