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


public class E
{
   public static void main(String[] args)
   {
      new E(new Scanner(System.in));
   }

   ArrayList<Integer> primes;

   void genPrimes(int N)
   {
      boolean[] isPrime = new boolean[N+1];
      Arrays.fill(isPrime, true);
      isPrime[0] = false;
      isPrime[1] = false;
      for (int i=2; i<=N; i++)
         if (isPrime[i])
            for (int j=i*i; j<=N; j+=i)
               isPrime[j] = false;

      primes = new ArrayList<Integer>();
      for (int i=0; i<=N; i++)
         if (isPrime[i])
            primes.add(i);
   }

   long pow(int p, int n)
   {
      long res = 1L;
      for (int i=0; i<n; i++)
      {
         if ((Long.MAX_VALUE/res) <= p)
            return Long.MAX_VALUE;
         res *= p;
      }

      return res;
   }

   long safemult(long a, long b)
   {
      if (b == 0) return 0;
      long c = Long.MAX_VALUE/b;
      if (c <= a)
         return Long.MAX_VALUE;
      return a*b;
   }

   long[][] memo;
   long go(int p, int n)
   {
      if ((p == primes.size())&&(n != 0))
         return Long.MAX_VALUE;
      if (n == 1)
         return 1L;

      if (memo[p][n] != -1L) return memo[p][n];

      long res = Long.MAX_VALUE;
      for (int i=1; i<=n; i++)
      {
         if ((n%i) != 0) continue;
         int cp = primes.get(p);
         
         long r2 = pow(cp, i-1);
         long r1 = go(p+1, n/i);
      
         r2 = safemult(r1, r2);
         if (r2 < res)
            res = r2;
      }

      memo[p][n] = res;
      return res;
   }

   public E(Scanner in)
   {
      int N = in.nextInt();
      genPrimes(100);
      memo = new long[primes.size()][N+1];
      for (long[] mem : memo)
         Arrays.fill(mem, -1L);

      long res = go(0, N);
      System.out.printf("%d%n", res);
   }
}
