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 = 1006;
int SQ[N];
int f[N];
long long dp[N][200];
long long INF = 1e18;
long long over(long long a, long long b) {
  if (a > 0 && b > 0 && a > INF / b) return INF;
  return a * b;
}
long long fp(long long b, long long p) {
  if (p == 0) return 1;
  long long t = fp(b, p / 2);
  if (p % 2 == 0) return over(t, t);
  return over(over(t, t), b);
}
vector<int> p;
void sieve() {
  for (int i = 2; i < N; i++)
    if (f[i] == 0) {
      p.push_back(i);
      for (int j = i * i; j < N; j += i) f[j] = 1;
    }
}
long long solve(int n, int idx) {
  if (n == 1) return 1;
  long long &ret = dp[n][idx];
  if (~ret) return ret;
  ret = INF;
  for (int i = 1; i <= SQ[n]; i++) {
    if (n % i == 0) {
      long long a = i, b = n / i;
      if (a != 1)
        ret = min(ret, over(solve(n / a, idx + 1), fp(p[idx], a - 1)));
      if (b != 1)
        ret = min(ret, over(solve(n / b, idx + 1), fp(p[idx], b - 1)));
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 1; i < N; i++) {
    SQ[i] = sqrt(i + 0.5);
  }
  sieve();
  memset(dp, -1, sizeof dp);
  int n;
  cin >> n;
  cout << solve(n, 0) << endl;
  return 0;
}
