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
import java.util.*;
import java.io.*;
import java.math.*;
public class Solution{
    
    static int n;
    static int[] p;
    
    static long[][] dp;
    
    static boolean prime(int val){
        for(int i=2;i<val;i++){
            if(val%i==0) return false;
        }
        return true;
    }
    
    static BigInteger max;
    
    static void func(int pos,int divisors,long val){
        
        if(pos>30) return ;
        if(divisors>n) return ;
        
        if(dp[pos][divisors]==0) dp[pos][divisors] = val;
        else if(dp[pos][divisors]>val) dp[pos][divisors] = val;
        else return ;
            
        if(pos==30) return ;
        
        BigInteger b;
        String sp = "";
        sp = sp.valueOf(p[pos]);
        String sv = "";
        sv = sv.valueOf(val);
        b = new BigInteger(sv);
        
        
        for(int i=1;i<60;i++){
            
            b = b.multiply(new BigInteger(sp));
            if(b.compareTo(max)>0) break;
            
            func(pos+1,divisors*(i+1),Long.parseLong(b.toString()));
            
        }
        
    }
    
    public static void main(String[] args)throws IOException{
                
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        
        PrintWriter out = new PrintWriter(System.out);
        
        n = Integer.parseInt(st.nextToken());
        
        p = new int[30];
        dp = new long[31][n+1];
        
        int ind = 0;
        int nb = 2;
        while(ind<30){
            while(!prime(nb)){
                nb++;
            }
            p[ind] = nb;
            nb++;
            ind++;
        }
        
        String s = "";
        s = s.valueOf((long)Math.pow(10,18));
        max = new BigInteger(s);
        
        func(0,1,1);
        
        long value = (long) Math.pow(10,18);
        
        for(int i=0;i<31;i++){
            if(dp[i][n]!=0) value = (long) Math.min(dp[i][n],value);
        }
        
        out.println(value);
        
        out.flush();
        
    }
    
}