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.*;


public class F
{
    static long pow(long p , int e)
    {
        long ans = 1 ;
        while (e --> 0)
        {
            if(ans <= 1e18 / p)
                ans *= p ;
            else
                return (long)1e18 ;
        }
        return ans ;
    }
    public static void main(String[] args) throws Exception
    {
        Scanner sc  =new Scanner();
        PrintWriter out = new PrintWriter(System.out) ;
        int n = sc.nextInt();
        int [] primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97} ;
        long [][] dp = new long [n + 1][primes.length + 1] ;
        for(int i = 0 ; i <= n ; i++)
            Arrays.fill(dp[i] , (long)1e18 + 1);
        Arrays.fill(dp[1] , 1);
        for(int d = 2 ; d <= n ; d ++)
            for(int idx = primes.length - 1 ; idx >= 0 ; idx--)
            {
                dp[d][idx] = dp[d][idx + 1] ;
                for(int i = 0 ; i <= 63 ; i ++)
                    if(d % (i + 1) == 0)
                    {
                        long pw = pow(primes[idx] , i) ;
                        if(dp[d / (i + 1)][idx + 1] <= 1e18 / pw)
                            dp[d][idx] = Math.min(dp[d][idx] , pw * dp[d / (i + 1)][idx+  1]) ;
                    }
            }
        out.println(dp[n][0]);
        out.flush();
        out.close();
    }
    static class Scanner
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ;
        StringTokenizer st ;

        String next() throws Exception
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine()) ;
            return st.nextToken() ;
        }
        int nextInt() throws Exception { return Integer.parseInt(next()) ; }

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

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