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;
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  long long arr[] = {2, 3, 5, 7, 11, 13, 17, 19, 23};
  long long n;
  cin >> n;
  if (n == 1) return cout << '1', 0;
  long long ans = 1;
  long long cur = 0;
  vector<long long> xx;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
        xx.push_back(i - 1);
      }
    }
  }
  if (n > 1) xx.push_back(n - 1);
  for (long long i = (long long)(xx.size()) - 1; i >= 0; i--) {
    long long cnt = 0;
    while (++cnt <= xx[i]) ans *= arr[cur];
    cur++;
  }
  cur--;
  long long yy = xx.back() + 1;
  long long divide = pow(2LL, xx.back());
  long long mult = pow(2LL, xx.back());
  for (long long i = 0; i < (long long)(xx.size()); i++) {
    long long x1 = 1;
    long long cnt = 0;
    while (++cnt <= xx[i]) x1 *= arr[cur];
    cur--;
    yy *= (xx[i] + 1);
    if (yy > 61) break;
    long long x2 = (long long)(pow(2LL, yy - 1));
    if (divide * x1 > x2) {
      divide *= x1;
      mult = x2;
    } else
      break;
  }
  cout << (ans / divide) * mult;
}
