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.ArrayList;
import java.util.List;
import java.util.Scanner;


public class ProblemE {

    
    static List<Integer> factors;
    
    static BigInteger ans = null;
    
    static int[] primes = new int[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 };
    
    static long max = 1;
    /**
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        factors = new ArrayList<Integer>();
        for (int i = 0; i < 18; i++) {
            max *= 10;
        }
        rec(n);
        System.out.println(ans.toString());
    }

    private static void rec(int n) {
        if (n == 1) {
            BigInteger A = BigInteger.ONE;
            for (int i = 0; i < factors.size(); i++) {
                for (int k = 0; k < factors.get(i) - 1; k++) {
                    A = A.multiply(new BigInteger(Integer.toString(primes[i])));
                }
            }
            if (ans == null || ans.compareTo(A) > 0) {
                ans = A;
            }
        } else {
            factors.add(n);
            rec(1);
            factors.remove(factors.size() - 1);
            for (int i = 2; i * i <= n; i++) {
                if (n % i == 0) {
                    factors.add(i);
                    rec(n / i);
                    factors.remove(factors.size() - 1);
                    factors.add(n / i);
                    rec(i);
                    factors.remove(factors.size() - 1);
                }
            }
        }
    }

}
