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())
factors = [i for i in range(2, n + 1) if n % i == 0]

primes = []
is_composite = [False] * (n + 1)
for i in range(2, n + 1):
    if not is_composite[i]:
        primes.append(i)
    for p in primes:
        j = i * p
        if j > n: break
        is_composite[j] = True
        if i % p == 0: break
            
def factorize(m = n, s = 0):
    if m == 1:
        return [[]]
    res = [[m]]
    for i in range(s, len(factors)):
        f = factors[i]
        if f > m ** 0.5: break
        if m % f != 0: continue
        else:
            for l in factorize(m // f, i):
                res.append([f] + l)
    return res

def rep_exp(a, b):
    if b == 0: return 1
    x = rep_exp(a, b//2)
    return x * x * (a if b % 2 == 1 else 1)


m = float('inf')
for l in factorize():
    prod = 1
    for i in range(len(l)):
        prod *= rep_exp(primes[len(l) - i - 1], l[i] - 1)
    m = min(prod, m)

print(m)