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;
int n;
const long long BIG = 1e18;
long long ans = BIG;
const int prime[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
vector<int> tmp;
long long mi(int x, int y) {
  long long ret = 1ll;
  for (int i = 0; i < y; i++) {
    ret *= (long long)x;
    if (ret >= BIG) return BIG;
  }
  return ret;
}
void solve(int par, int curn) {
  if (curn == 1) {
    long long a = 1ll;
    for (int i = tmp.size() - 1; i >= 0; i--) {
      if (tmp[i] > 1) a *= mi(prime[tmp.size() - 1 - i], tmp[i] - 1);
      if (a >= ans || a < 0) {
        return;
      }
    }
    if (a < ans) ans = a;
    return;
  }
  for (int i = par; i <= curn; i++) {
    if (curn % i == 0) {
      tmp.push_back(i);
      solve(i, curn / i);
      tmp.pop_back();
    }
  }
  return;
}
int main() {
  cin >> n;
  solve(2, n);
  printf("%lld\n", ans);
}
