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 isprime(q):
    f = 2
    while f * f <= q:
        if q % f == 0:
            return False
        f += 1
    return True

k = int(input())
d = []
i = 2
while i * i <= k:
    if k % i == 0:
        cnt = 0
        while k % i == 0:
            k //= i
            d += [i - 1]
    i += 1
if k != 1:
    d += [k - 1]
d = sorted(d)
cock = 2
ans = 1
for i in range(len(d) - 1, -1, -1):
    x = 1
    for j in range(d[i]):
        x *= cock
    ans *= x
    cock += 1
    while not isprime(cock):
        cock += 1
print(ans)
