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> tt;
int prime[13] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41};
long long int ret;
void solve(int n) {
  tt.push_back(-n);
  vector<int> zz = tt;
  sort(zz.begin(), zz.end());
  long long int temp = 1;
  double tz = 0;
  for (int i = 0; i < tt.size(); ++i) {
    tz += log(prime[i]) * (-zz[i] - 1);
    for (int j = 0; j < -zz[i] - 1; ++j) temp *= prime[i];
  }
  if (exp(tz) >= 1e18 - 1) temp = 1e18;
  ret = min(ret, temp);
  tt.pop_back();
  if (n == 1) return;
  for (int i = 2; i <= sqrt(n) + 1; ++i)
    if (n % i == 0) {
      tt.push_back(-i);
      solve(n / i);
      tt.pop_back();
    }
}
int main() {
  int n;
  cin >> n;
  ret = 1e18;
  solve(n);
  cout << ret << endl;
}
