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.math.BigInteger;


public class problem27E {
	public static void main(String[] args) throws IOException {
		new problem27E().run();
	}
	StreamTokenizer in;
	PrintWriter out;
	int nextInt() throws IOException {
		in.nextToken();
		return (int) in.nval;
	}
	char nextChar() throws IOException {
		in.nextToken();
		return ((String) in.sval).charAt(0);
	}
	void run() throws IOException {
		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(
				System.in)));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		out.flush();
	}
	void solve() throws IOException {
		int[] z=new int[2005];
		int n=nextInt();
		if(n==1)
		{
			out.println(1);
			return;
		}
		for(int q=2;q<=n;q++)
			if(n%q==0)
				z[q]=1;
		BigInteger[][] dp=new BigInteger[11][n+1];
		for(int q=0;q<11;q++)
			for(int w=0;w<=n;w++)
				dp[q][w]=BigInteger.ZERO;
		long[] prime={2,3,5,7,11,13,17,19,23,29};
		for(int q=0;q<=n;q++)
		{
			if(z[q]==1)
			{
				dp[1][q]=new BigInteger("1").shiftLeft(q-1);
			}
		}
		for(int q=2;q<10;q++)
			for(int w=2;w<=n;w++)
				if(dp[q-1][w].compareTo(BigInteger.ZERO)>0)
					for(int e=2;e<=n;e++)
						if(z[e]==1&&w*e<=n)
						{
							if(dp[q][w*e].compareTo(BigInteger.ZERO)==0||dp[q][w*e].compareTo(dp[q-1][w].multiply(new BigInteger(""+prime[q-1]).pow(e-1)))>0)
								dp[q][w*e]=dp[q-1][w].multiply(new BigInteger(""+prime[q-1]).pow(e-1));
						}
//		for(int q=1;q<=5;q++)
//		{
//			for(int w=0;w<=n;w++)
//				out.print(dp[q][w]+" ");
//			out.println();
//		}
		BigInteger max=new BigInteger("10000000000000000000000000000000000000000000000000000000000000000000");
		for(int q=1;q<10;q++)
			if(max.compareTo(dp[q][n])>0&&dp[q][n].compareTo(BigInteger.ZERO)!=0)
				max=dp[q][n];
		out.println(max);
		
		
		
		
		
		
		
		
		
	}
}
