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;
vector<int> dv;
long long ret;
int p[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
void dfs(int at, int left, long long sofar, int pos, int mult, int depth) {
  ;
  if (mult > 1) {
    long long n2 = sofar;
    bool ok = true;
    for (int i = 0; i < mult - 1; i++) {
      if (n2 > ret / p[at]) {
        ok = false;
        break;
      }
      n2 *= p[at];
    }
    if (ok) dfs(at + 1, left, n2, 0, 1, depth + 1);
  }
  if (left == 0 && mult == 1) {
    ret = min(ret, sofar);
    return;
  }
  for (; pos < int(dv.size()); ++pos) {
    if ((left & (1 << pos)) == 0) continue;
    if (pos == 0 || (left & (1 << (pos - 1))) == 0 || dv[pos] != dv[pos - 1]) {
      dfs(at, left - (1 << pos), sofar, pos, mult * dv[pos], depth + 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  int tmp = n;
  for (int i = 2; i <= n; i++) {
    while (tmp % i == 0) tmp /= i, dv.push_back(i);
  }
  ret = 2e18;
  dfs(0, (1 << int(dv.size())) - 1, 1, 0, 1, 0);
  cout << ret << endl;
  return 0;
}
