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.util.*;
import java.util.regex.Matcher;

public class Main {

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(in, out);
        out.close();
    }

    private static class TaskB {

        static final long max = 1000000000000000000L;
        static final double eps = 0.000001;
        static int n, m;
        static long ans;

        void solve(InputReader in, PrintWriter out) throws IOException {

            n = in.nextInt();

            long primes[] = new long[]{2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
            long dp[][] = new long[n + 1][10];

            for (int i = 1; i <= n; i++)
                for (int j = 0; j < 10; j++)
                    dp[i][j] = Long.MAX_VALUE;

            for (int i = 0; i < 10; i++)
                dp[1][i] = 1;

            for (int i = 2; i <= n && i <= 64; i++)
                dp[i][0] = (long) Math.pow(2, (i - 1));

            for (int i = 2; i <= n; i++) {

                for (int j = 1; j < 10; j++) {

                    for (int k = 1; k <= 64; k++) {

                        if ((long) Math.pow(primes[j], k) > max) break;

                        if (i % (k + 1) == 0) {
                            long curr = dp[i / (k + 1)][j - 1] * (long) Math.pow(primes[j], k);
                            if (curr > 0) {
                                dp[i][j] = Math.min(dp[i][j], curr);
                            }
                        }
                    }
                }
            }

            ans = Long.MAX_VALUE;

            for (int i = 0; i < 10; i++) {
                if (dp[n][i] < ans) ans = dp[n][i];
            }
            out.println(ans);

        }
        
        double segment(double x1, double y1, double x2, double y2) {
            return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
        }

        long gcd(long a, long b) {
            if (b == 0) return a;
            return gcd(b, a % b);
        }

        long lcm(long a, long b) {
            return (a * b) / gcd(a, b);
        }

    }

    private static class InputReader {
        StringTokenizer st;
        BufferedReader br;

        public InputReader(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public InputReader(FileReader s) throws FileNotFoundException {
            br = new BufferedReader(s);
        }

        public String next() {
            while (st == null || !st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            return st.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public boolean ready() {
            try {
                return br.ready();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}