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 long long N = 1005, K = 12, oo = 1e18;
long long dp[N][K];
bitset<2 * N + 10> bs;
vector<long long> primes;
void sieve(long long n) {
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long i = 2; i <= n; ++i)
    if (bs[i]) {
      for (long long j = i * i; j <= n; j += i) bs[j] = 0;
      primes.push_back(i);
    }
}
long long Pow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a;
    a = a * a;
    n >>= 1;
  }
  return res;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  clock_t tStart = clock();
  long long n;
  sieve(2 * N);
  cin >> n;
  long long res = oo;
  for (long long i = 0, _n = (12); i < _n; i++)
    for (long long product = (1), _b = (n); product <= _b; product++)
      dp[product][i] = oo;
  dp[1][0] = 1;
  for (long long i = (1), _b = (11); i <= _b; i++) {
    for (long long product = (1), _b = (n); product <= _b; product++) {
      long long p = 1;
      for (long long j = (1), _b = (product); j <= _b; j++) {
        if (oo / primes[i - 1] < p) break;
        if (j != 1) p = p * primes[i - 1];
        if (product % j == 0) {
          if (oo / p >= dp[product / j][i - 1])
            dp[product][i] = min(dp[product][i], dp[product / j][i - 1] * p);
        }
      }
      if (product == n) res = min(res, dp[product][i]);
    }
  }
  cout << res << '\n';
  fprintf(stderr, "Time taken: %.2fs\n",
          (double)(clock() - tStart) / CLOCKS_PER_SEC);
  return 0;
}
