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;
int n, i, j, k;
bool ok;
int pr[100];
long long ans;
long long f(long long res, int pp, int deg) {
  long long zz = res;
  for (int i = 1; i < deg; i++) {
    zz = zz * pp;
    if ((zz % pp != 0) || (zz / pp != res)) {
      return -1;
    }
    res = zz;
  }
  return res;
}
void doit(int m, int i, int up, long long res) {
  long long zz;
  if (i == 10) {
    if (m > up) return;
    zz = f(res, pr[i], m);
    if (zz < 0) return;
    if (ans < 0)
      ans = zz;
    else if (ans > zz)
      ans = zz;
  }
  int j = 2;
  while ((j * j <= m) && (j <= up)) {
    if (m % j == 0) {
      zz = f(res, pr[i], j);
      if (zz > 0) doit(m / j, i + 1, j, zz);
      zz = f(res, pr[i], m / j);
      if ((zz > 0) && (m / j <= up)) doit(j, i + 1, m / j, zz);
    }
    j++;
  }
  if (m <= up) {
    zz = f(res, pr[i], m);
    if (zz < 0) return;
    if (ans < 0)
      ans = zz;
    else if (ans > zz)
      ans = zz;
  }
}
int main() {
  cin >> n;
  for (i = 2; i <= 100; i++) {
    ok = true;
    for (j = 2; j * j <= i; j++) {
      if (i % j == 0) ok = false;
    }
    if (ok) {
      k++;
      pr[k] = i;
    }
  }
  ans = -1;
  doit(n, 1, n, 1);
  cout << ans;
  return 0;
}
