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

public class cf27e {
	static int numPrimes = 20;
	static BigInteger oo = new BigInteger("1000000000000000000000");
	static BigInteger[][] memo;
	static BigInteger[] primes;
	public static void main(String[] args) {
		int crnt = 0;
		int test = 2;
		primes = new BigInteger[numPrimes];
		while(crnt < numPrimes) {
			boolean works = true;
			for(int i=2; i<test; i++)
				if(test%i==0)
					works = false;
			if(works)
				primes[crnt++] = BigInteger.valueOf(test);
			test++;
		}
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		memo = new BigInteger[n+1][numPrimes+1];
		System.out.println(go(n,0));
	}
	static BigInteger go(int left, int pos) {
		if(left == 1) return BigInteger.ONE;
		if(pos == numPrimes) return oo;
		if(memo[left][pos] != null) return memo[left][pos];
		BigInteger ret = oo;
		for(int i=2; i<=left; i++)
			if(left%i==0) {
				BigInteger tmp = go(left/i,pos+1).multiply(primes[pos].pow(i-1));
				if(tmp.compareTo(ret) < 0)
					ret = tmp;
			}
		return memo[left][pos] = ret;
	}
}
