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).
n = int(input())


def prime(x):
    if x == 1:
        return False
    p = True
    for i in range(2, x):
        if x % i == 0:
            p = False
    return p


factors = []

for i in range(1, n+1):
    if n % i == 0:
        factors.append(i)

prime_factors = []
for i in factors:
    if prime(i):
        prime_factors.append(i)

prime_factorisation = []
for i in prime_factors:
    count = 0
    run = True
    while run:
        if n % i == 0:
            n /= i
            count += 1
        else:
            run = False

    for j in range(count):
        prime_factorisation.append(i)

prime_factorisation.sort()
prime_factorisation.reverse()

prime_nums = []
i = 2
while len(prime_nums) < len(prime_factorisation):
    if prime(i):
        prime_nums.append(i)
    i += 1

ans = 1
for i in range(len(prime_factorisation)):
    ans *= prime_nums[i]**(prime_factorisation[i] - 1)

print(ans)