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 maxn = 2050;
const long long lim = 1e18;
int prime[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
long long res;
int n;
void dfs(int now, long long mul, int tot) {
  if (tot == 1) {
    res = min(res, mul);
    return;
  }
  for (int i = 2;; i++) {
    int flag = 1;
    for (int j = 2; j <= prime[now]; j++) {
      if (mul * j > lim) {
        flag = 0;
        break;
      }
    }
    if (!flag) break;
    mul *= prime[now];
    if (tot % i) continue;
    dfs(now + 1, mul, tot / i);
  }
}
void solve() {
  scanf("%d", &n);
  res = lim;
  dfs(0, 1, n);
  printf("%lld\n", res);
}
int main() {
  solve();
  return 0;
}
