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{
    public static int n;
    public static long m = (long)Math.pow(10,18);
    public static long[] t;
    public static int[] p;
    public static void dp(long prime,int div,long num){
        int nb = 1;
        while(true){
            nb++;
            if(div*nb>n) return;
            if(m/prime+1<num) return;
            num *= prime;
            //System.out.println(num+" "+(div*nb));
            t[div*nb] = Math.min(t[div*nb],num);
            if(t[div*nb]==0) t[div*nb] = num;
        }
    }
    public static void main(String[] args)throws IOException{
        BufferedReader br =  new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());
        n = Integer.parseInt(st.nextToken());
        t = new long[n+1];
        t[1] = 1;
        p = new int[1000];
        p[0] = 2;
        p[1] = 3;
        p[2] = 5;
        int nb=3;
        for(int i=7;i<1000000;i+=2){
            if(nb==1000) break;
            boolean ok = true;
            for(int j=3;j*j<=i;j++){
                if(i%j==0){
                    ok = false;
                    break;
                }
            }
            if(ok){
                p[nb] = i;
                nb++;
            }
        }
        for(int i=0;i<1000;i++){
            for(int j=n-1;j>0;j--){
                if(t[j]!=0) dp((long)p[i],j,t[j]);
            }
        }
        //int cnt = 0;
        //for(int i=1;i<=n;i++) if(t[i]==0) cnt++;
        out.println(t[n]);
        out.flush();
   }
}