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.util.Arrays;
import java.util.Scanner;


public class E {
    
    static int[]prime = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
    static long p = (long) 1e18;
    static long ans = Long.MAX_VALUE;
    static int n;
    static int[]power = new int[10];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        solve(1, 0);
        System.out.println(ans);
    }
    private static void solve(long mult, int k) {
        if (k >= 10) {
            return;
        }
        int div = 1;
        for (int i = 0; i < 10; i++) {
            div *= (power[i]+1);
        }
        if (div==n)
            ans = Math.min(ans, mult);
        for (int i = 1; i <= 65; i++) {
            if (mult <= p / (long)Math.pow(prime[k], i)) {
                power[k] = i;
                solve(mult*(long)Math.pow(prime[k], i), k+1);
                power[k] = 0;
            }
            else
                break;
        }
    }
}
