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
//package main;

import java.util.*;
import java.math.*;

public class Main {
    public static boolean check_prime(int a)
    {
        for(int i = 2; i <= Math.sqrt(a); ++i)
        {
            if(a % i == 0)
            {
                return false;
            }
        }
        
        return true;
    }
    
    public static void main(String[] args) {
        BigInteger inf = BigInteger.valueOf(1000);
        inf = inf.multiply(BigInteger.valueOf(3));
        for(int i = 0; i < 5; ++i)
        {
            inf = inf.multiply(BigInteger.valueOf(1000));
        }
        BigInteger[][] dp = new BigInteger[1001][11];
        for(int i = 0; i <= 1000; ++i)
        {
            for(int j = 0; j <= 10; ++j)
            {
                dp[i][j] = BigInteger.valueOf(3 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000);
            }
        }
        int[] prime = new int[10];
        for(int i = 2, j = 0; j < 10; ++i)
        {
            if(check_prime(i))
            {
                prime[j++] = i;
            }
        }
        for(int i = 0; i <= 1000; ++i)
        {
            for(int j = 0; j <= 10; ++j)
            {
                dp[i][j] = inf;
            }
        }
        dp[1][0] = BigInteger.valueOf(1);
        for(int j = 1; j <= 10; ++j)
        {
            for(int i = 0; i <= 1000; ++i)
            {
                dp[i][j] = dp[i][j - 1];
            }
            for(int i = 1; i <= 1000; ++i)
            {
                BigInteger cur = BigInteger.valueOf(prime[j - 1]),
                    add = cur;
                for(int k = 1; i * (k + 1) <= 1000; ++k, cur = cur.multiply(add))
                {
                    if(dp[i * (k + 1)][j].compareTo(dp[i][j - 1].multiply(cur)) > 0)
                    {
                        dp[i * (k + 1)][j] = dp[i][j - 1].multiply(cur);
                    }
                }
            }
        }
        
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        
        System.out.println(dp[n][9]);
    }
}
