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.util.Scanner;
import java.math.BigInteger;



public class Main {

    /**
     * @param args
     */
    static int prims[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
    static BigInteger oo = new BigInteger("100000000000000000000");
    static BigInteger[][] dp = new BigInteger[1009][20];
    static BigInteger calc(int n, int idx) {
        if(n == 1)
            return BigInteger.ONE;
        if(idx>= 11)
            return oo;
        BigInteger ret = oo;
        if(dp[n][idx]!=null)
            return dp[n][idx];
        BigInteger cur = BigInteger.ONE;
        for (int k = 0; k < 64; k++) {
            if(n%(k+1) == 0) {
                BigInteger tmp = calc(n/(k+1), idx+1).multiply(cur);
                if(tmp.compareTo(ret) == -1) {
                    ret = tmp;
                }
            }
            cur = cur.multiply(BigInteger.valueOf(prims[idx]));
        }
        return dp[n][idx] = ret;
    }
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        System.out.println(calc(n, 0));
    }

}
