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 const N = 1010;
long long const amax = 1000000000000000000LL;
long long const p[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
long long dp[N][12];
vector<int> v[N];
long long f(int n, int m) {
  if (dp[n][m] != -1) return dp[n][m];
  if (n == 1) return dp[n][m] = 1;
  int sz = v[n].size();
  long long ret = amax;
  for (int i = 0; i < (sz); ++i) {
    long long k = v[n][i];
    long long x = f(n / k, m + 1);
    bool fail = 0;
    for (int j = 0; j < (k - 1); ++j) {
      if (x > amax / p[m]) {
        fail = 1;
        break;
      }
      x *= p[m];
    }
    if (!fail) {
      ret = min(ret, x);
    }
  }
  return dp[n][m] = ret;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= (n); ++i)
    for (int j = 0; j < (12); ++j) dp[i][j] = -1;
  for (int i = 2; i <= n; ++i)
    for (int j = i; j <= n; j += i) v[j].push_back(i);
  long long ans = f(n, 0);
  printf("%I64d\n", ans);
  return 0;
}
