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.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Zyflair Griffane
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		PandaScanner in = new PandaScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		E solver = new E();
		solver.solve(1, in, out);
		out.close();
	}
}

class E {
    final long primes[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 };
    public void solve(int testNumber, PandaScanner in, PrintWriter out) {
        int n = in.nextInt();
        long dp[][] = new long[11][n + 1];
        for (int i = 0; i < 10; i++) {
            Arrays.fill(dp[i], Long.MAX_VALUE);
            dp[i][1] = 1;
        }
        for (int i = 1; i <= n / 2; i++) {
            for (int j = 0; j < 10; j++) {
                long p = primes[j];
                for (int k = 2; i * k <= n; k++, p *= primes[j]) {
                    if (dp[j + 1][i * k] / p >= dp[j][i]) {
                        dp[j + 1][i * k] = dp[j][i] * p;
                    }
                    if (Long.MAX_VALUE / primes[j] < p) {
                        break;
                    }
                }
            }
        }
        long min = Long.MAX_VALUE;
        for (int i = 0; i < 10; i++) {
            min = Math.min(min, dp[i][n]);
        }
        out.println(min);
    }
}

class PandaScanner {
    public BufferedReader br;
    public StringTokenizer st;
    public InputStream in;

    public PandaScanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(this.in = in));
    }

    public String nextLine() {
        try {
            return br.readLine();
        }
        catch (Exception e) {
            return null;
        }
    }

    public String next() {
        if (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(nextLine().trim());
            return next();
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }

