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 sys
import math
input = sys.stdin.readline
def fg():
    return int(input())
def fgh():
    return [int(xx) for xx in input().split()]
'''n, k = fgh()
a = fgh()
b = []
for i in range(n):
    q1 = 0
    q2 = 0
    while a[i] % 2 == 0:
        a[i] = a[i] // 2
        q1 += 1
    while a[i] % 5 == 0:
        a[i] = a[i] // 5
        q2 += 1
    b.append((q1, q2))
dp = [[[0] * (n * 19) for i in range(n + 1)] for j in range(n + 1)]
for i in range(n):'''
n = int(input())
p = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61]
ans = 1
q = 0
pp = []
for i in range(2, n + 1):
    if n % i == 0:
        while n % i == 0:
            pp.append(i)
            n //= i
pp = sorted(pp)[::-1]
for i in pp:
    ans *= p[q] ** (i - 1)
    q += 1
print(ans)

