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.math.BigInteger;
import java.util.Scanner;


public class x {

	/**
	 * @param args
	 */
	static int primes[]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};
	static int nprs=primes.length;
	static BigInteger OO=new BigInteger("1000000000000000009");
	static BigInteger memo[][]=new BigInteger[nprs][2001];
	public static BigInteger dp(int idx,int rem)
	{
		if(rem==1)return BigInteger.ONE;
		if(idx==nprs) return OO;
		if(memo[idx][rem]!=BigInteger.valueOf(-1)) return memo[idx][rem];
		int p=1;
		BigInteger cur=BigInteger.ONE;
		BigInteger ret=OO;
		for(;p<=rem&&cur.compareTo(OO)==-1;p++)
		{
			if(rem%p==0)
				ret=ret.min(dp(idx+1,rem/p).multiply(cur));
			cur=cur.multiply(BigInteger.valueOf(primes[idx]));
		}
		return memo[idx][rem]=ret;
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		BigInteger no=BigInteger.valueOf(-1);
		for(int i=0;i<nprs;++i)
			for(int j=0;j<2001;++j)
				memo[i][j]=no;
		int x=in.nextInt();
		//x*=2;
		System.out.print(dp(0,x));
		//System.out.print(dp(0,x).min(dp(0,x-1)));
		
		
	}

}
