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> p;
bool isp[1010];
void getp() {
  for (int i = 2; i < 1010; i++) {
    if (!isp[i]) {
      for (int j = i + i; j < 1010; j += i) {
        isp[j] = true;
      }
    }
  }
  for (int i = 2; i < 1010; i++) {
    if (!isp[i]) {
      p.push_back(i);
    }
  }
}
int main() {
  getp();
  long double ans = 1e21, cnt;
  multiset<int, greater<int> > s;
  int n, j, x;
  cin >> n;
  if (n == 1) {
    ans = 1;
  }
  int i = 2;
  while (n != 1) {
    if (n % i == 0) {
      s.insert(i);
      n /= i;
      s.insert(n);
      j = 0;
      cnt = 1;
      for (auto it = s.begin(); it != s.end(); it++) {
        x = *it - 1;
        cnt *= pow(p[j++], x);
      }
      ans = min(ans, cnt);
      if (!isp[n]) {
        break;
      }
      s.erase(n);
    } else {
      i++;
    }
  }
  cout << fixed << setprecision(0) << ans << endl;
  return 0;
}
