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

public class NumberWithTheGivenAmountOfDivisors {
    static int[] primes = new int[27];
    static Long[][] dp=new Long[1<<10][1<<6];
    public static long go(int curr, int prime) {
        if(curr==1)
            return 1;
        if(dp[curr][prime]!=null)
            return dp[curr][prime];
        long min = Long.MAX_VALUE;
        int maxPow =(int)( Math.log(1e18)/Math.log(primes[prime])+1e-7);
        for (int i = 2; i <= maxPow; i++) {
            if (curr % i == 0) {
                min = (long) Math.min(min, Math.pow(primes[prime], i-1) * go(curr / i, prime + 1));
            }
        }
        return dp[curr][prime]=min;
    }

    public static void main(String[] args) {
        InputReader r = new InputReader(System.in);
        int c = 0;
        for (int i = 2; i < 100; i++) {
            boolean isPrime = true;
            for (int y = 2; y < i; y++) {
                if (i % y == 0) {
                    isPrime = false;
                }
            }
            if (isPrime){
                primes[c++] = i;
            }
        }
        int n = r.nextInt();
        System.out.println(go(n, 0));
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

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

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

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