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 = 1e3 + 100;
long long oo = LLONG_MAX, mx = 1e18;
long long n, pr[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43},
             mem[N][10];
vector<long long> dv;
long long pow_(long long a, long long b) {
  if (!b) {
    return 1ll;
  }
  if (b & 1) {
    return max(-1LL, a * pow_(a, b - 1));
  }
  long long res = pow_(a, b / 2);
  if (res > 1e9 || res < 0) {
    return -1ll;
  }
  res *= res;
  return res;
}
void start(long long n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      dv.push_back(i), dv.push_back(n / i);
    }
  }
  dv.push_back(n);
}
long long dp(int nn, int ind) {
  if (nn > n) {
    return oo;
  }
  if (nn == n) {
    return 1ll;
  }
  if (ind == 10) {
    return oo;
  }
  if (mem[nn][ind] != -1) {
    return 1ll * mem[nn][ind];
  }
  long long ans = dp(nn, ind + 1);
  for (auto x : dv) {
    long long num = nn * x;
    long long pw = pow_(pr[ind], x - 1);
    if (pw == -1) {
      continue;
    }
    long long nx = dp(num, ind + 1);
    if (pw > mx / nx) {
      continue;
    }
    ans = min(ans, nx * pw);
  }
  return mem[nn][ind] = 1ll * ans;
}
int main() {
  memset(mem, -1, sizeof mem);
  scanf("%lld", &n);
  start(n);
  long long ans = dp(1, 0);
  printf("%lld\n", ans);
}
