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

Input

The first line of the input contains integer n (1 ≤ n ≤ 1000).

Output

Output the smallest positive integer with exactly n divisors.

Examples

Input

4


Output

6


Input

6


Output

12
class Primos:
   
    def __init__(self, MAX):
        self.Max=MAX
        self.primos=[True]*(MAX+1)
        self.ListPrimes=[]

        for i in xrange(2,int(MAX**0.5)+1):
            if self.primos[i]:
                for j in xrange(i*i,self.Max+1,i):
                    self.primos[j]=False
        #Listing primes
        
        for p in range(2,MAX+1):
            if self.primos[p]: self.ListPrimes.append(p)
        
             
    def esPri(self,n):
        return self.primos[n]
       
    def Primorial(self, N):
    	pri=1
    	for i in xrange(N):
    		pri*=self.getPrimesList()[i]
    	return pri
    
    def PrimeFactors(self, N):
    	d={}
    	for i in xrange(2, N/2+1):
    		if self.esPri(i) and N%i is 0:
    			p=0
    			while (N%(i**p) is 0): p+=1
    			d[i]=p-1
    	return d

    def getPrimesList(self):
        return tuple(self.ListPrimes)

	
P=Primos(3000)

def F(N):
	global P

	if P.esPri(N): return 2**(N-1)
	
	if N is 8: return 24
	
	
	res, pi=1,0
	L=P.getPrimesList()
	
	F= P.PrimeFactors(N)
	Fs=sorted(F, reverse=1)



	for p in Fs:
		for j in xrange(F[p]):
			res*=L[pi]**(p-1)
			pi+=1
			
		
	return res
		


print F(int(raw_input().replace(" ","")))


