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.io.*;
import java.util.*;
import java.math.*;

public class Main implements Runnable {
	
	final static int K = 100;

	public void _main() throws IOException {
		List<Integer> primes = sieve(K);
		int n = nextInt();
		BigInteger[][] d = new BigInteger[K + 1][n + 1];
		BigInteger inf = BigInteger.valueOf(2000000000000000000L);
		for (int i = 0; i < K + 1; i++)
			Arrays.fill(d[i], inf);
		d[0][1] = BigInteger.ONE;
		BigInteger res = null;
		for (int i = 0; i < K; i++) {
			for (int prod = 0; prod <= n; prod++) {
				if (d[i][prod].equals(inf)) continue;
				for (int j = 0; j < K; j++) {
					int nprod = prod * (j + 1);
					if (nprod > n) break;
					BigInteger pw = BigInteger.valueOf(primes.get(i)).pow(j);
					if (d[i + 1][nprod].compareTo(d[i][prod].multiply(pw)) > 0) {
						d[i + 1][nprod] = d[i][prod].multiply(pw);
						if (nprod == n && (res == null || res.compareTo(d[i + 1][nprod]) > 0))
							res = d[i + 1][nprod];
					}
				}
			}
		}
		out.print(res);
	}

	List<Integer> sieve(int num) {
		List<Integer> res = new ArrayList<Integer>();
		boolean[] isp = new boolean[100000];
		Arrays.fill(isp, true);
		for (int i = 2; ; i++) {
			if (isp[i]) {
				res.add(i);
				if (res.size() >= num)
					return res;
				for (int j = i + i; j < isp.length; j += i)
					isp[j] = false;
			}
		}
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String rl = in.readLine();
			if (rl == null)
				return null;
			st = new StringTokenizer(rl);
		}
		return st.nextToken();
	}

	private int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		new Thread(new Main()).start();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			_main();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(202);
		}
	}

}
