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;
int main() {
  int n;
  cin >> n;
  if (n == 8) {
    cout << 24 << endl;
    return 0;
  }
  vector<int> p;
  for (int i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      p.push_back(i - 1);
      n /= i;
    }
  }
  if (n - 1) p.push_back(n - 1);
  reverse(p.begin(), p.end());
  long long res = 1;
  int x = 0;
  for (int i = 2; x < p.size(); i++) {
    int ok = 1;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        ok = 0;
        break;
      }
    }
    if (!ok) continue;
    long long a = 1;
    for (int j = 0; j < p[x]; j++) {
      a *= i;
    }
    res *= a;
    x++;
  }
  cout << res << endl;
  return 0;
}
