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.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

/**
 *
 * @author TuAnh
 */
public class E27 {

    private static final int MODE = 2;
    private static final long snt[]= {2,3,5,7,11,
                                    13,17,19,23,29};
    private static int a[]= new int[17];
    private static long res=Math.round(1e18+1);
    private static int n;
    private static void dfs(int i,long r,long rr){        
        if(r==n){
            res=Math.min(res,rr);
            return;
        }
        if(r>n || i>=10 || rr>=res) return;
        int k=(int)Math.round(Math.log(res/rr)/Math.log(snt[i]));
        for(int j=k;j>=0;j--)
        if(n%(j+1)==0){
            long add=Math.round(Math.pow(snt[i],j));
            dfs(i+1,r*(j+1),rr*add);
        }
    }
    public static void main(String agrs[]) throws Exception {        
        n=inp.nextInt();       
        dfs(0,1,1);
        pw.println(res);
        pw.flush();
        pw.close();
    }

    /**
     * ******************************************
     */

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            if (MODE == 1) {
                FileInputStream f;
                try {
                    f = new FileInputStream("e:\\spoj\\input.txt");
                    br = new BufferedReader(new InputStreamReader(f));
                } catch (FileNotFoundException ex) {
                    br = new BufferedReader(new InputStreamReader(System.in));
                }
            } else {
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            st = new StringTokenizer("");
        }

        String next() throws Exception {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        int nextInt() throws Exception {
            return Integer.parseInt(next());
        }

        public long nextLong() throws Exception {
            return Long.parseLong(next());
        }

        public String nextLine() throws Exception {
            return br.readLine();
        }

        public double nextDouble() throws Exception {
            return Double.parseDouble(next());
        }

        public boolean ready() throws Exception {
            return br.ready();
        }
    }
    private static FastScanner inp = new FastScanner();
    private static PrintWriter pw = new PrintWriter(System.out);

}
