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).

wynik = []
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]

def go(V, iloczyn):
    if sum(V) <= 62:
        wynik.append(V)
        #print(V)
    else:
        return
        
    if len(V) == 15:
        return
    if iloczyn > 10**18:
        return
    for a in range(min(62 - sum(V), V[-1]), 0, -1):
        go(V + [a], iloczyn * prime[len(V)]**a)
    
for i in range(62, 0, -1):
    go([i], 2**i)


def mul(V):
    res = 1
    for v in V:
        res *= (v + 1)
    return res

def number(V):
    res = 1
    for i in range(len(V)):
        res *= prime[i]**V[i]
    
    return res

res = 10**18

N = int(input())

for V in wynik:
    if mul(V) == N:
        res = min(res, number(V))
    

print(res)