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.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
// This have another dfs solution

public class Main {
    static int[] p = new int[]{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31}; // first primes
    static long[][] pp = new long[11][100];
    static int[] u = new int[11];
    static long inf = 1L << 62;
    public static void main(String[] args) {
        for(int i = 0; i < p.length; i++){
            pp[i][0] = 1;
            BigInteger v = BigInteger.ONE;
            for(int pw = 1;; pw++){
                v = v.multiply(BigInteger.valueOf(p[i]));
                if(v.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0){
                    u[i] = pw - 1;
                    break;
                } else {
                    pp[i][pw] = p[i] * pp[i][pw - 1];
                }
            }
        }
        Scanner r = new Scanner(System.in);
        
        int N = r.nextInt();

        long[][] DP = new long[15][1010];
        
        for (long[] i : DP)
            Arrays.fill(i, inf);
        DP[11][1] = 1;
        
        for (int i = 10; i >= 0; i--){
            for(int x = 1; x <= 1000; x++){
                for (int d = 1; d * d <= x; d++) 
                if(x % d == 0){
                    if(d - 1 <= u[i]){
                        if((double)pp[i][d - 1] * DP[i + 1][x / d] <= (double)inf)
                            DP[i][x] = Math.min(DP[i][x], pp[i][d - 1] * DP[i + 1][x / d]);
                    }
                    if(x / d - 1 <= u[i]){
                        if((double)pp[i][x / d - 1] * DP[i + 1][d] <= (double)inf)
                            DP[i][x] = Math.min(DP[i][x], pp[i][x / d - 1] * DP[i + 1][d]);
                    }
                }
            }
        }
        
        System.out.println(DP[0][N]);
        
    }

}