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 prime[11] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
unsigned long long mi = (unsigned long long)(1e18);
unsigned long long qpow(unsigned long long a, unsigned long long b) {
  unsigned long long ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a *= a;
    b >>= 1;
  }
  return ans;
}
int c = 0;
void div(int n, int m, priority_queue<int> q) {
  if (n == 1) {
    unsigned long long now = 1;
    int i = 0;
    while (q.size()) {
      now *= qpow(prime[i++], q.top() - 1);
      q.pop();
    }
    c++;
    if (mi > now) mi = now;
    return;
  }
  if (m < 2 || n <= 0) return;
  if (n < m) {
    div(n, n, q);
  } else {
    div(n, m - 1, q);
    if (m <= 64 && n % m == 0) {
      q.push(m);
      div(n / m, m, q);
    }
  }
}
int main() {
  int n;
  cin >> n;
  priority_queue<int> q;
  div(n, n, q);
  cout << mi << endl;
}
