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 oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
long long mem[1010][1010];
long long pw[1010][1010];
long long prime[1010];
const long long mx = 0x7FFFFFFFFFFFFFFF;
void init() {
  int cnt = 0;
  for (int i = 2; i < (int)(1010); i++) {
    prime[cnt++] = i;
    for (int k = 2; k < (int)(i); k++) {
      if (i % k == 0) {
        cnt--;
        break;
      }
    }
  }
  for (int i = 1; i < (int)(1010); i++)
    for (int k = 1; k < (int)(1010); k++) pw[i][k] = mx;
  for (int i = 1; i < (int)(1010); i++) {
    pw[i][0] = 1;
    for (int k = 1; k < (int)(1010); k++) {
      if (mx / i > pw[i][k - 1]) {
        pw[i][k] = i * pw[i][k - 1];
      } else
        break;
    }
  }
}
long long solve(int n, int idx) {
  if (mem[n][idx] != -1) return mem[n][idx];
  if (n == 1) return 1;
  long long mn = mx;
  for (int i = n; i >= 2; i--) {
    if (n % i == 0 && pw[prime[idx]][i - 1] < mx) {
      long long t = solve(n / i, idx + 1);
      if (mx / pw[prime[idx]][i - 1] > t) {
        mn = min(mn, pw[prime[idx]][i - 1] * t);
      }
    }
  }
  return mem[n][idx] = mn;
}
int main() {
  init();
  int n;
  memset(mem, -1, sizeof(mem));
  cin >> n;
  cout << solve(n, 0) << endl;
  return 0;
}
