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.InputStreamReader;


public class C {

	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static int primes[] = {2,3,5,7,11,13,17,19,23,29,31};
	static long ans = 0;
	static boolean seen = false;

	static void dfs(int idx,long n,long num)
	{
		if(n == 1)
		{
			if(!seen)
			{
				seen = true;
				ans = num;
			}
			else
			{
				ans = Math.min(ans,num);
			}
			return;
		}
		if(idx == 11) return;
		long curr_prime = primes[idx]; long curr = curr_prime;
		for(int i = 1 ; curr <= Long.MAX_VALUE/curr_prime ; i++)
		{
			if(curr <=Long.MAX_VALUE/num && (n)%(i+1)==0)
			{
				dfs(idx+1,n/(i+1),num*curr);
			}
			curr *= curr_prime;
		}
		
	}
	public static void main(String[]args)throws Throwable
	{
		long x = Long.parseLong(br.readLine());
		dfs(0,x,1L);
		System.out.println(ans);
	}


}