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 is_prime( n ):

    i = 2

    while i * i <= n:

        if n % i == 0:
            return ( False )

        i += 1

    return ( True )

m = {}

p = []

i = 2

while len(p) < 10:

    if is_prime(i):
        p.append(i)

    i += 1

#print( p )

def numDiv( n ):

    global p

    pf_idx = 0

    pf = p[pf_idx]

    ans = 1

    while pf * pf <= n:

        power = 0

        while n % pf == 0:
            n //= pf
            power += 1

        ans *= ( power + 1 )

        pf_idx += 1
        pf = p[pf_idx]

    if n != 1:
        ans *= 2

    return ( ans )

INF = 10**18

m = {}

ans = INF

def f( a, b ):

    global ans

    if b >= len(p):
        return

    if numDiv(a) == n:
        ans = min( ans, a )
        return

    if a*p[b] <= ans:
        f( a*p[b], b )
    f( a, b+1 )

n = int( input() )

#for i in range( len(p) ):
#    f( p[i], i )

f( 1, 0 )

print( ans )
