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 mod = 1e9 + 7;
template <typename T>
void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) {
    write(x / 10);
  }
  putchar(x % 10 + '0');
}
template <typename T>
void read(T &x) {
  x = 0;
  char ch = getchar();
  long long f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f *= -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  x *= f;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a / gcd(a, b) * b; };
long long ksm(long long a, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = (ans * a) % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ans % mod;
}
long long n;
const long long maxn = 20;
long long vis[maxn], pri[maxn], tot;
long long Pow[maxn][100];
long long Lim[maxn];
void init() {
  for (long long i = 2; i < maxn; i++) {
    if (!vis[i]) pri[tot++] = i;
    for (long long j = 0; j < tot && i * pri[j] < maxn; j++) {
      vis[i * pri[j]] = 1;
      if (i % pri[j] == 0) break;
    }
  }
  for (long long i = 0; i <= tot; ++i) {
    long long now = 1;
    for (long long j = 0; j <= 100; ++j) {
      Pow[i][j] = now;
      now *= pri[i];
    }
  }
}
long long ans = INT64_MAX;
void dfs(long long now, long long pos, long long cnt, long long lim) {
  if (now <= 0ll) {
    return;
  }
  if (now > ans) return;
  if (cnt == n) {
    ans = min(ans, now);
    return;
  }
  if (pos >= tot) return;
  if (cnt > n) return;
  for (long long i = 0; i <= lim; ++i) {
    dfs(now * Pow[pos][i], pos + 1, cnt * (i + 1), i);
  }
}
long long solve() {
  init();
  dfs(1, 0, 1, 63);
  return ans;
}
signed main() {
  read(n);
  write(solve());
  return 0;
}
