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.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Divisors {
	static ArrayList<Integer> primes;
	static long ans;
public static void backtrack(int x,int []cnt)
{
	
	if(x==1)
	{
		ans=Math.min(ans, simulate(cnt.clone()));
	}
	else
	{
		for(int i=2;i<60;i++)
		{
			if(x%i==0)
			{
				
				
				cnt[i]++;
				backtrack(x/i,cnt.clone());
				cnt[i]--;
				
			}
		}
	}
}
public static long simulate(int []cnt)
{
	long curr=1;
	int prime=0;
	for(int i=59;i>1;i--)
	{
		while(cnt[i]>=1)
		{
			cnt[i]--;
			curr*=Math.pow(primes.get(prime++), i-1);
		}
	}
	return curr;
}
	public static void main(String[] args) {
		int n=new Scanner(System.in).nextInt();
		
		
		 primes=new ArrayList();
		boolean []	isPrime=new boolean[100];
		Arrays.fill(isPrime, true);
		for(int i=2;i<100;i++)
		{
			if(!isPrime[i])
				continue;
			primes.add(i);
			for(int j=2;j*i<100;j++)
				isPrime[i*j]=false;
		}
		ans=Long.MAX_VALUE;
		backtrack(n,new int [60]);
		System.out.println(ans);
	}

}
