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
// practice with kaiboy
import java.io.*;
import java.util.*;

public class CF27E extends PrintWriter {
	CF27E() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF27E o = new CF27E(); o.main(); o.flush();
	}

	static final long INF = 0x3f3f3f3f3f3f3f3fL;
	long ans = INF;
	int[] pp = { 2, 3, 5, 7, 11, 13, 17, 19, 23 };
	void solve(int n, int b, int i, long m) {
		if (n == 1) {
			ans = Math.min(ans, m);
			return;
		}
		int p = pp[i];
		for (int a = 2; a <= b && m <= INF / p; a++, m *= p)
			if (n % a == 0)
				solve(n / a, a, i + 1, m * p);
	}
	void main() {
		int n = sc.nextInt();
		solve(n, 60, 0, 1);
		println(ans);
	}
}
