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

public class Main implements Runnable
{
   long[][] dp;
   long inf = 2000000000000000000l;
   final int[] primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
   
   long go(int n, int k) {
      if (n == 1) return 1;
      if (dp[n][k] != 0) return dp[n][k];
      long ret = inf;
      long p = primes[k];
      c1: for (int i = 2; i <= n; i++) if (n%i == 0) {
         long suffix = go(n/i, k+1);
         long prefix = 1;
         for (int j = 0; j < i-1; j++)
            if (prefix > inf/p) break c1;
            else prefix *= p;
         if (prefix > inf/suffix) continue;
         ret = Math.min(ret, prefix*suffix);
      }
      return dp[n][k] = ret;
   }
   
   void solution() throws Exception
   {
      int n = nextInt();
      dp = new long[n+1][10];
      out.println(go(n, 0));
   }
   
   ///////////////////// Template definitions //////////////////////////
   int nextInt() throws IOException { return Integer.parseInt(next()); }
   long nextLong() throws IOException { return Long.parseLong(next()); }
   double nextDouble() throws IOException { return Double.parseDouble(next()); }
   
   String next() throws IOException {
      while (st == null || !st.hasMoreTokens()) {
         String l = in.readLine();
         if (l == null) return null;
         st = new StringTokenizer(l);
      }
      return st.nextToken();
   }
   
   public static void main(String args[]) {
      Locale.setDefault(Locale.UK);
      new Thread(new Main()).start();
   }
   
   public void run() {
      try {
         boolean online = System.getProperty("ONLINE_JUDGE") != null;
         Reader reader = online
            ? new InputStreamReader(System.in)
            : new FileReader("my.in");
         in = new BufferedReader(reader);
         out = new PrintWriter(System.out);
         solution();
         out.flush();
         out.close();
      }
      catch (Exception e) {
         e.printStackTrace();
         System.exit(202);
      }
   }
   
   BufferedReader in;
   StringTokenizer st;
   PrintWriter out;
}