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.*;

public class Main {
    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    long T18 = 1000000000000000000L;
    int[] primes = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };
    int pNum = 9;
    int[] maxDeg = { 60, 38, 26, 22, 18, 17, 15, 15, 14, 13, 13, 12, 12, 12, 11 };
    long[][] primePow;
    
    long answer = Long.MAX_VALUE;
    
    void run() throws IOException {
        primePow = new long [pNum][70];
        for (int i = 0; i < pNum; i++) {
            long cp = primes[i];
            primePow[i][0] = 1L;
            for (int deg = 1; deg <= maxDeg[i]; deg++)
                primePow[i][deg] = primePow[i][deg - 1] * cp;
        }
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        rec(n, 1L, 0, n);
        System.out.println(answer);
    }
    
    void rec(int rest, long have, int curPrime, int maxDivisor) {
        if (rest == 1) {
            answer = Math.min(answer, have);
        } else if (curPrime < pNum) {
            for (int div = Math.min(maxDivisor, maxDeg[curPrime] + 1); div > 1; div--) {
                if (rest % div == 0) {
                    long curPow = primePow[curPrime][div - 1];
                    if (!(have > T18 / curPow)) {
                        rec(rest / div, have * curPow, curPrime + 1, div);
                    }
                }
            }
        }
    }
}
