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.*;
public class Major {
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	long dp[][] = new long[n + 1][11];
	long max = 1000000000000000000L;
	for(int i = 0;i <= n;i++)
		Arrays.fill(dp[i],Long.MAX_VALUE);
		dp[1][0] = 1;
		int array[] = new int[]{0,2,3,5,7,11,13,17,19,23,29};
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= 10;j++){
			long pow = 1;
			int cnt = 1;
			while(pow < max){
			if(i % cnt == 0 && dp[i/cnt][j - 1] <= max*1.0/pow)
			dp[i][j] = Math.min(dp[i][j],dp[i/cnt][j - 1]*pow);
			long init = pow;
			pow *= array[j];
			if(pow <= init)break;
			++cnt;
		}
		//System.out.println(i + " " + j + " " + dp[i][j]);
	}
}
System.out.println(dp[n][10]);
}
}