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.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);

        solve();

        in.close();
        out.close();
    }

    private static void solve() throws Exception {
        ArrayList<Integer> prost = new ArrayList<Integer>();
        for (int i = 2; i <= 1000; i++) {
            if (isProst(i))
                prost.add(i);
        }
        int N = nextInt();
        deep(0, 61, prost, N, 1);
        out.println(answer);
    }

    static final long MAX = 1000000000000000000L;
    static long answer = MAX;
    
    private static void deep(int i, int lim, ArrayList<Integer> prost, int N, long curPow) {
        if (N == 1) {
            answer = Math.min(answer, curPow);
            return;
        }
        lim = Math.min(lim, (int) (Math.log10(MAX / curPow) / Math.log10(prost.get(i))));
        long pow = prost.get(i);
        for (int b = 1; b <= lim; b++, pow *= prost.get(i)) {
            if (N % (b + 1) == 0) {
                deep(i + 1, b, prost, N / (b + 1), curPow * pow);
            }
        }
    }

    private static boolean isProst(int v) {
        for (int i = 2; i * i <= v; i++) {
            if (v % i == 0)
                return false;
        }
        return true;
    }


    private static BufferedReader in;
    private static PrintWriter out;
    private static StringTokenizer st;

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

    static int nextInt() throws IOException {
        return Integer.parseInt(nextString());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(nextString());
    }
}
