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 oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
double large = 1000000000000000000.;
double primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
int n;
double power(double x, int p) {
  double ans = 1ll;
  for (int i = 0; i < p; ++i) {
    ans *= x;
    if (ans > large) return large + 1.;
  }
  return ans;
}
double ans;
vector<int> powers;
void f(int d) {
  if (d == 1) {
    vector<int> v = powers;
    double tmpans = 1.;
    for (int i = 0; i < (int)powers.size(); ++i) {
      tmpans *= power(primes[i], powers[i]);
      if (tmpans > large) {
        return;
      }
    }
    ans = min(ans, tmpans);
    return;
  }
  for (int i = 2; i <= d; ++i) {
    if (d % i == 0) {
      powers.push_back(i - 1);
      f(d / i);
      powers.pop_back();
    }
  }
}
int main() {
  cin >> n;
  ans = large + 2;
  f(n);
  cout << (long long)ans << endl;
  return 0;
}
