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;
void coutx(double q, int x) {
  cout << fixed << setprecision(x) << q << endl;
  return;
}
inline long long ksc(long long x, long long y, long long mod) {
  return (x * y - (long long)((long double)x / mod * y) * mod + mod) % mod;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
unsigned long long p[16] = {2,  3,  5,  7,  11, 13, 17, 19,
                            23, 29, 31, 37, 41, 43, 47, 53};
unsigned long long ans = ~0ull;
long long n;
void dfs(unsigned long long k, unsigned long long sum, unsigned long long num,
         unsigned long long up) {
  if (num > n || k > 15) {
    return;
  }
  if (num == n) {
    if (sum < ans) ans = sum;
    return;
  }
  for (long long i = 1; i <= up; i++) {
    if (sum / p[k] > ans) break;
    dfs(k + 1, sum = sum * p[k], num * (i + 1), i);
  }
  return;
}
int main() {
  srand((unsigned int)time(0));
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (scanf("%lld", &n) != EOF) {
    ans = ~0ull;
    dfs(0, 1, 1, 64);
    cout << ans << endl;
  }
  return 0;
}
