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.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Arrays;


public class Main {
    static StreamTokenizer in=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));  
    static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));  
      
    public static int nextInt()throws IOException {in.nextToken();return (int)in.nval;}  
    public static long nextLong()throws IOException {in.nextToken(); return (long)in.nval;}
    public static String next()throws IOException {in.nextToken();return (String)in.sval;}

    static int pn[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
    static long ans = (long)1e18;
    static int n;
    public static void main(String[] args) throws IOException {
    	n = nextInt();
    	dfs(1, 1, 0);
    	out.println(ans);
    	out.flush();
    	out.close();
    }
    public static void dfs(int pos, long now, int x) {
    	if (pos > n)
    		return;
    	if (now > ans)
    		return;
    	if (pos == n) {
    		ans = now;
    		return;
    	}
    	for (int i = 1; i <= 64; i++) { 
    		if (ans / pn[x] < now) break;
    		dfs(pos * (i + 1), now *= pn[x], x + 1);
    	}
    }
    
}


 	 	  				 	 									  			 	 	