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.*;
import java.math.*;

public class Solution
{

BufferedReader in;
PrintWriter out;
StringTokenizer ss;

String _token()throws IOException
{
   while (!ss.hasMoreTokens())ss=new StringTokenizer(in.readLine());
   return ss.nextToken();
}
int _int()throws IOException
{
   return Integer.parseInt(_token());
}
long _long()throws IOException
{
   return Long.parseLong(_token());
}
double _double()throws IOException
{
   return Double.parseDouble(_token());
}

void dbg(String s){System.out.println(s);}

BigInteger a(BigInteger A, BigInteger B){return A.add(B);}
BigInteger m(BigInteger A, BigInteger B){return A.multiply(B);}
BigInteger s(BigInteger A, BigInteger B){return A.subtract(B);}
BigInteger d(BigInteger A, BigInteger B){return A.divide(B);}
                                                            

int [] p = new int[10000];


long best_ans;
long tek_ans;

long deg(int k, int l)
{
 long ans = 1;
 for (int i=0;i<l;i++){if (Long.MAX_VALUE/p[k]<=ans)return Long.MAX_VALUE; ans*=p[k];}
 return ans;
}

long ans(int n, int k, int d)
{
//   dbg(n+" "+k+" "+d +" "+best_ans+" "+tek_ans);
   if ((tek_ans > best_ans && best_ans >0)  ||tek_ans==Long.MAX_VALUE) return tek_ans;

   if (n==1) {best_ans = tek_ans; return tek_ans;}

   for (int i=2;i<=d;i++)
      {
       if (n%i==0)
         {  
            long q = deg(k,i-1);
//            dbg(q+"");
            if (tek_ans < Long.MAX_VALUE / q) 
            {
               tek_ans=tek_ans*q;
               ans(n/i,k+1,i);
               tek_ans=tek_ans/q;
            } 
         }  
      }
   return 0;
}


void RUN()throws IOException
{
   in = new BufferedReader(new InputStreamReader(System.in));
   out = new PrintWriter(System.out);
   ss = new StringTokenizer(" "); 

   int n = _int();
   
   int N = 10000;
   int [] prime = new int[N];

   int last=0;
   for (int i=2;i<N;i++)
      if (prime[i]==0)
        { for (int j=i*i;j<N;j+=i)
             prime[j]=i;
          p[last++]=i;
        }

  
   tek_ans=1;
//   best_ans=Long.MAX_VALUE;
   ans(n,0,n);

//   for (int i=1;i<=1000;i++){ans(i,0,i);dbg(i+"");}

   out.println(best_ans);
   out.close();
}


public static void main(String[] args)throws Exception
{
try {new Solution().RUN();}catch (Exception e){System.out.println("RE");};
}

}