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.Arrays;
import java.util.Scanner;
import static java.lang.System.out;

public class Main {
    private static void debug(Object...os) {
        out.println(Arrays.deepToString(os));
    }

    static BigInteger INFINITY = new BigInteger("11111111111111111111");
    static int[] prime = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 };
    static BigInteger[][] memo;

    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        while (cin.hasNext()) {
            int n = cin.nextInt();
            memo = new BigInteger[prime.length][n + 1];
            out.println(solve(0, n));
        }
    }

    private static BigInteger solve(int index, int N) {
        if (N == 1) return BigInteger.ONE;
        if (index == prime.length) return INFINITY;
        if (memo[index][N] != null)
            return memo[index][N];
        BigInteger res = INFINITY;
        for (int power = 1; power <= 64; ++power)
            if (N % power == 0) {
                BigInteger value = BigInteger.valueOf(prime[index]).pow(power - 1).multiply(solve(index + 1, N / power));
                res = res.min(value);
            }
        return memo[index][N] = res;
    }
}