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
pri = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
tpr = 10
I = 1000000000000000007

def gen(idx, rem, res, mn):
	if rem == 1:
		return res
	if idx == tpr:
		return I
	x = pri[idx]
	i, ret = 1, I
	while res * x <= I:
		if rem % (i + 1) == 0:
			ret = min(ret, gen(idx + 1, rem / (i + 1), res * x, i))
		x *= pri[idx]
		i += 1
	return ret

n = input()
print gen(0, n, 1, I)
