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 long long mod = 1e9 + 7;
const int N = 5 + 1e5;
const long long INF = 2e18;
const long double LINF = log2(4e18);
long long POW[70][70];
vector<int> primes;
long long solve(int n, int i) {
  if (n == 1) return 1ll;
  long long ret = INF;
  for (int j = 2; j <= n; ++j) {
    if (n % j == 0) {
      if (j > 65) break;
      if (!POW[i][j - 1]) break;
      long long x = solve(n / j, i + 1);
      if ((log2(x) + log2(POW[i][j - 1])) > LINF) continue;
      ret = min(ret, x * POW[i][j - 1]);
    }
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  for (int i = 2; i <= 70; ++i) {
    int c = 0;
    for (int j = 1; j <= i; ++j)
      if (i % j == 0) ++c;
    if (c == 2) primes.push_back(i);
  }
  for (int i = 0; i < primes.size(); ++i) {
    POW[i][0] = 1;
    for (int j = 1; j < 65; ++j) {
      if ((log2(POW[i][j - 1]) + log2(primes[i])) > LINF) break;
      POW[i][j] = POW[i][j - 1] * primes[i];
    }
  }
  int n;
  cin >> n;
  cout << solve(n, 0);
}
