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>
template <typename T>
inline void qr(T &x) {
  register char ch = getchar(), lst = ' ';
  while ((ch > '9') || (ch < '0')) lst = ch, ch = getchar();
  while ((ch >= '0') && (ch <= '9'))
    x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  if (lst == '-') x = -x;
}
namespace IO {
char buf[120];
}
template <typename T>
inline void qw(T x, const char aft, const bool pt) {
  if (x < 0) {
    x = -x, putchar('-');
  }
  register int top = 0;
  do {
    IO::buf[++top] = x % 10 + '0';
  } while (x /= 10);
  while (top) putchar(IO::buf[top--]);
  if (pt) putchar(aft);
}
template <typename T>
inline T mmax(const T a, const T b) {
  return a > b ? a : b;
}
template <typename T>
inline T mmin(const T a, const T b) {
  return a < b ? a : b;
}
template <typename T>
inline T mabs(const T a) {
  return a < 0 ? -a : a;
}
template <typename T>
inline void mswap(T &_a, T &_b) {
  T _temp = _a;
  _a = _b;
  _b = _temp;
}
const int prime[] = {2,  3,  5,  7,  11, 13, 17, 19,
                     23, 29, 31, 37, 41, 43, 47, 53};
int n;
long long int ans = 1000000000000000001;
void dfs(long long int, int, int, int);
int main() {
  qr(n);
  dfs(1ll, 0, 64, 1);
  qw(ans, '\n', true);
  return 0;
}
void dfs(long long int now, int cur, int p, int cnt) {
  if (cnt > n) return;
  if (now <= 0ll) return;
  if (now > ans) return;
  if (cur > 15) return;
  if (cnt == n) {
    ans = now;
    return;
  }
  for (int i = 1; i <= p; ++i) {
    dfs(now *= prime[cur], cur + 1, i, cnt * (i + 1));
  }
}
