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.*;
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    static int mod = (int)1e9+7;
    static int inf = (int)1e9+7;
    static int N = 1005;
    int[] p = {2,3,5,7,11,13,17,19,23,29,31};
    int n;
    long ans;
    void dfs(int num, int dep, long ret) {
        if(ret < ans && num == n) ans = ret;
        if(num >= n) return ;
        for(int i = 1; i <= 64; i ++) {
            if(ret > ans/p[dep] ) break;
            ret *= p[dep];
            dfs(num*(i+1), dep+1, ret);
        }
    }
    void work() throws Exception {
        //in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        //
        Scanner cin = new Scanner(System.in);
        /////////////////////////////////////////
        n = cin.nextInt();
        ans=(long)1e18;
        dfs(1,0,1);
        out.println(ans);
    }  
    static PrintWriter out;
  //  BufferedReader in;
  //  StringTokenizer str = null;
//    private String next() throws Exception{
//      while (str == null || !str.hasMoreElements())
//          str = new StringTokenizer(in.readLine());
//      return str.nextToken();
//    } 
//    private int nextInt() throws Exception{
//      return Integer.parseInt(next());
//    }
//    private long nextLong() throws Exception{
//      return Long.parseLong(next());
//    }
    static int dx[] = {0,1,0,-1};
    static int dy[] = {1,0,-1,0};
    class pair implements Comparable<pair>{
        int first, second;
        pair(int x, int y) {
            first = x;
            second = y;
        }
        public int compareTo(pair o) {
            // TODO auto-generated method stub
            if(first != o.first) return ((Integer)first).compareTo(o.first);
            else return ((Integer)second).compareTo(o.second); 
        }
    }
    DecimalFormat df=new DecimalFormat("0.000000");
    public static void main(String[] args) throws Exception{
        Main wo = new Main();
        wo.work();
        out.close();
    }
}