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 = 100001;
const int mod = 1000000007;
const long long inf = numeric_limits<long long>::max();
int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23};
bool overflows(long double a, long double e, long double b) {
  if (e * log2(a) + log2(b) > 63) return true;
  return false;
}
long long p(long long base, long long power) {
  long long res = 1;
  while (power) {
    if (power & 1) res *= base;
    base *= base;
    power /= 2;
  }
  return res;
}
long long res = inf;
void solve(int n, int last, int id, long long ans) {
  if (n == 1 || ans >= res) {
    res = min(res, ans);
    return;
  }
  for (int i = last; i >= 2; --i) {
    if (n % i == 0 && !overflows(primes[id], i - 1, ans)) {
      solve(n / i, i, id + 1, ans * p(primes[id], i - 1));
    }
  }
}
int main() {
  int n;
  cin >> n;
  solve(n, n, 0, 1LL);
  cout << res;
  return 0;
}
