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>
char *fs, *ft, buf[1 << 20];
inline int read() {
  int x = 0, f = 1;
  char ch =
      (fs == ft && (ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin), fs == ft))
          ? 0
          : *fs++;
  ;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = (fs == ft &&
          (ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin), fs == ft))
             ? 0
             : *fs++;
    ;
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = (fs == ft &&
          (ft = (fs = buf) + fread(buf, 1, 1 << 20, stdin), fs == ft))
             ? 0
             : *fs++;
    ;
  }
  return x * f;
}
using namespace std;
const unsigned long long N = 1e5 + 50;
const unsigned long long inf = 0x3f3f3f3f;
const unsigned long long mod = 1e9 + 7;
unsigned long long p[16] = {2,  3,  5,  7,  11, 13, 17, 19,
                            23, 29, 31, 37, 41, 43, 47, 53},
                   n, mi = 2e18;
void dfs(unsigned long long now, unsigned long long cnt,
         unsigned long long last, unsigned long long deep) {
  if (now > 1e18 || deep >= 16 || cnt > n) return;
  if (cnt == n) {
    mi = min(mi, now);
    return;
  }
  unsigned long long cur = p[deep];
  for (unsigned long long i = 1; i <= last; i++) {
    if (now / p[deep] > mi) break;
    dfs(now * cur, cnt * (i + 1), i, deep + 1);
    cur *= p[deep];
  }
}
signed main() {
  cin >> n;
  dfs(1, 1, 64, 0);
  cout << mi << '\n';
}
