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
#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
const int inf = 0x3f3f3f3f;
const long long infll = 0x3f3f3f3f3f3f3f3fll;
int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
long long dp[N][N][11];
long long fpow(long long a, long long b) {
  ;
  long long c = 1;
  for (; b; b >>= 1, a = a * a)
    if (b & 1) c *= a;
  ;
  return c;
}
long long func(double tot, int val, int big, int phase) {
  if (val == 1) return 1LL;
  if (dp[val][big][phase] != infll) return dp[val][big][phase];
  for (int i = big; i >= 2; i--) {
    if (val % i == 0) {
      double ntot = tot + (i - 1) * log10(primes[phase]);
      if (ntot > 18.1) continue;
      ;
      long long aux = 0;
      if (func(ntot, val / i, i, phase + 1) == infll) {
        aux = infll;
      } else {
        aux = fpow(primes[phase], i - 1) * func(ntot, val / i, i, phase + 1);
      }
      dp[val][big][phase] = min(dp[val][big][phase], aux);
    }
  };
  return dp[val][big][phase];
}
int main() {
  int n;
  scanf("%d", &n);
  memset(dp, inf, sizeof(dp));
  printf("%lld", func(0.0, n, n, 0));
}
