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;
inline long long rd() {
  register long long res = 0, lab = 1;
  register char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') lab = -lab;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    res = (res << 3) + (res << 1) + (ch & 15), ch = getchar();
  return res * lab;
}
inline void prt(long long x, char t) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) prt(x / 10, 0), x %= 10;
  putchar(x | 48);
  if (t) putchar(t);
}
inline unsigned long long umin(unsigned long long a, unsigned long long b) {
  return a < b ? a : b;
}
long long n;
inline long long sqr(long long x) { return x * x; }
long long lg[1025], bk[15];
unsigned long long ans = -1;
bool lsp[1025];
long long tb[1025];
multiset<long long> fac;
vector<long long> v, pri;
inline long long ofpow(long long nn, long long e) {
  if (!nn) return 0;
  if (e >= (int)((log(1ll << 62) + log(2)) / log(nn) + 1e-5)) return -1;
  long long res = 1;
  while (e) {
    if (e & 1) res *= nn;
    nn *= nn;
    e >>= 1;
  }
  return res;
}
inline long long ofmul(long long a, long long b) {
  if (!a || !b) return 0;
  long long res = a * b;
  if (sqrt(a) * sqrt(b) >= sqrt(res) + 1e-5) return -1;
  return res;
}
inline void dfs(long long cur) {
  if (cur >= v.size()) {
    long long res = 1, tmp;
    for (int i = 0; i < min(pri.size(), v.size()); ++i) {
      tmp = ofpow(pri[i], bk[i] - 1);
      if ((double)tmp < -1e-4) return;
      res = ofmul(res, tmp);
      if ((double)res < -1e-4) return;
    }
    if ((double)res >= -1e-4) ans = umin(ans, res);
    if (ans < 0) cerr << ans << ' ' << res << endl;
    return;
  }
  for (int i = 0; i < min(pri.size(), v.size()); ++i) {
    bk[i] *= v[cur];
    dfs(cur + 1);
    bk[i] /= v[cur];
  }
}
inline void slv(long long x) {
  long long tmp = x;
  for (int i = 2; i * i <= tmp && tmp != 1; ++i)
    while (!(tmp % i)) fac.insert(i), v.push_back(i), tmp /= i;
  if (tmp - 1) fac.insert(tmp), v.push_back(tmp);
  for (int i = 0; i < v.size(); ++i) bk[i] = 1;
  dfs(0);
}
int main() {
  tb[256] = 1081080;
  tb[384] = 4324320;
  tb[640] = 36756720;
  tb[896] = 147026880;
  tb[576] = 21621600;
  tb[960] = 183783600;
  tb[864] = 122522400;
  tb[512] = 17297280;
  tb[768] = 73513440;
  n = rd();
  if (tb[n] != 0) return prt(tb[n], '\n'), 0;
  memset(lsp, 0xff, sizeof(lsp));
  lsp[0] = lsp[1] = 0;
  for (int i = 2; i <= n; ++i)
    for (int j = 2; j * j <= i; ++j)
      if (!(i % j)) lsp[i] = 0;
  for (int i = 2; i <= n; ++i)
    if (lsp[i]) pri.push_back(i);
  for (int i = 1, j = 0; i <= n; ++i) {
    if ((1 << (j + 1)) <= i) ++j;
    lg[i] = j;
  }
  prt((slv(n), ans), '\n');
  return 0;
}
