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

/**
 * _27E
 * O(n) + O(log(32)^log(32)) operations on BigInteger (pretty loose bound, in practice way less)
 * θ(n) space
 *
 * @author artyom
 */
public class _27E implements Runnable {
    private static final BigInteger[] primes = {
            new BigInteger("2"),
            new BigInteger("3"),
            new BigInteger("5"),
            new BigInteger("7"),
            new BigInteger("11"),
            new BigInteger("13"),
            new BigInteger("17"),
            new BigInteger("19"),
            new BigInteger("23")};
    private BufferedReader in;
    private PrintStream out;
    private StringTokenizer tok;
    private int[] divs, y;

    private void solve() throws IOException {
        Deque<Integer> stack = new LinkedList<>();
        int n = nextInt();
        if (n == 1) {
            out.print(1);
            return;
        }
        for (int i = 2; i <= n; i++) {
            if (n % i == 0) {
                stack.push(i);
            }
        }
        divs = new int[stack.size()];
        for (int i = 0; i < divs.length; i++) {
            divs[i] = stack.pop();
        }
        y = new int[n + 1];
        for (int i = 0; i < divs.length; i++) {
            y[divs[i]] = i;
        }
        out.print(findMin(0, 0));
    }

    private BigInteger findMin(int pi, int di) {
        BigInteger min = primes[pi].pow(divs[di] - 1);
            for (int i = di + 1; i < divs.length; i++) {
            if (divs[di] % divs[i] == 0) {
                BigInteger s = primes[pi].pow(divs[i] - 1).multiply(findMin(pi + 1, y[divs[di] / divs[i]]));
                if (s.compareTo(min) < 0) {
                    min = s;
                }
            }
        }
        return min;
    }

    //--------------------------------------------------------------
    public static void main(String[] args) {
        new _27E().run();
    }

    @Override
    public void run() {
        try {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = System.out;
            tok = null;
            solve();
            in.close();
        } catch (IOException e) {
            System.exit(0);
        }
    }

    private String nextToken() throws IOException {
        while (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
}