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.PrintWriter;
import java.util.Scanner;
import java.util.Vector;


public class E {

    static long pow(int x, int n){
        long res = 1l;
        for(int i = 0; i < n; i++){
            res = res * x;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int[] primes = {2, 3, 5, 7, 11, 13, 17, 19, 23};
        Vector<Integer> nPrimes = new Vector<Integer>();
        
        while(n != 1){
            for(int i = 2; i <= n; i++){
                if (n % i == 0){
                    n /= i;
                    nPrimes.insertElementAt(i - 1, 0);
                    break;
                }
            }
        }
        
        if (nPrimes.size() >= 3 && nPrimes.get(0) == 1 && nPrimes.get(1) == 1){
            nPrimes.set(0, 3);
            nPrimes.remove(1);
            if (nPrimes.size() >= 5 && nPrimes.get(1) == 1 && nPrimes.get(2) == 1){
                nPrimes.set(1, 3);
                nPrimes.remove(2);
                if (nPrimes.size() >= 7){
                    nPrimes.set(0, 7);
                    nPrimes.remove(2);
                    
                }
            }
        }
        
        long result = 1;
        for(int i = 0; i < nPrimes.size(); i++){
            result *= pow(primes[i], nPrimes.get(i));
        }
        out.println(result);
        in.close();
        out.close();
        return;
    }

}
