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.Collections;
import java.util.Scanner;
import java.util.Vector;

public class Matrix2019F {
	static int n;
	static BigInteger ans = BigInteger.valueOf(-1);
	static int B[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
			53 };

	static BigInteger qp(BigInteger x, int n) {
		BigInteger ans = BigInteger.ONE;
		while (n != 0) {
			if ((n & 1) != 0) {
				ans = ans.multiply(x);
			}
			x = x.multiply(x);
			n >>= 1;
		}
		return ans;
	}

	static Vector<Integer> v = new Vector<Integer>();

	static void dfs(int x)// x分解与否
	{

		{
			v.add(x);
			Vector<Integer> temp = new Vector<Integer>(v);
			Collections.sort(temp);
			Collections.reverse(temp);
			/*
			 * for(int i: temp){ System.out.print(i+"?"); }
			 */
			BigInteger t = BigInteger.ONE, q;
			for (int i = 0; i < temp.size(); i++) {
				q = qp(BigInteger.valueOf(B[i]), temp.get(i) - 1);
				t = t.multiply(q);
			}
			if (ans.equals(BigInteger.valueOf(-1)) || ans.compareTo(t) > 0)
				ans = t;
			v.remove(v.size() - 1);
		}
		if (x <= 1) {
			return;
		}
		for (int i = 2; i * i <= x; i++) {
			if (x % i == 0) {
				v.add(i);
				dfs(x / i);
				v.remove(v.size() - 1);
			}
		}

	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		ans = BigInteger.valueOf(-1);
		dfs(n);
		System.out.print(ans );

	}
}
