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 int N = 1010;
long long mem[N][N];
vector<int> primes;
long long pw(int x, int y) {
  long long res{1};
  while (y--) {
    if (res > LLONG_MAX / x) {
      return -1;
    }
    res *= x;
  }
  return res;
}
long long Solve(int x, int use) {
  long long& ref = mem[x][use];
  if (ref >= 0) return ref;
  if (x == 1) return ref = 1;
  ref = LLONG_MAX;
  for (int j = 1; j < x; ++j) {
    if (x % (j + 1) == 0) {
      long long p = pw(primes[use], j);
      if (p < 0) break;
      long long other = Solve(x / (j + 1), use + 1);
      if (other < LLONG_MAX / p) {
        ref = min(ref, other * p);
      }
    }
  }
  return ref;
}
void Run() {
  int n;
  cin >> n;
  cout << Solve(n, 0) << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  for (int i = 2; i <= 1000; ++i) {
    bool p = true;
    for (int j = 2; j * j <= i; ++j) {
      if (i % j == 0) {
        p = false;
        break;
      }
    }
    if (p) primes.push_back(i);
  }
  memset(mem, -1, sizeof(mem));
  Run();
  return 0;
}
