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 long long inf = 0x3f3f3f3f3f3f3f3f, up = 1e18;
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int prime[16] = {99999999, 2,  3,  5,  7,  11, 13, 17,
                 19,       23, 29, 31, 37, 41, 43, 47};
long long ans = inf;
void dfs(int id, int tt, long long x = 1, int lim = 63) {
  if (tt == 1) {
    ans = min(ans, x);
    return;
  }
  long long pp = 1;
  for (int i = 1; i <= lim; ++i) {
    pp *= prime[id];
    if (up / x < pp) return;
    if (i >= tt) return;
    if (tt % (i + 1) == 0) dfs(id + 1, tt / (i + 1), x * pp, i);
  }
}
int main() {
  int n = read();
  dfs(1, n);
  printf("%lld\n", ans);
  return 0;
}
