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;
long long f(long long x, long long k) {
  if (k == 0) return 1;
  long long ans = f(x, k / 2);
  ans *= ans;
  if (k % 2) ans *= x;
  return ans;
}
int p[205], prime[205], cnt_prime;
bool not_prime[1005];
vector<int> v;
int main() {
  for (int i = 2; i <= 35; ++i)
    if (!not_prime[i])
      for (int j = i * i; j <= 1000; j += i) not_prime[j] = true;
  for (int i = 2; i <= 1000; ++i)
    if (!not_prime[i]) prime[cnt_prime++] = i;
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("1");
    return 0;
  }
  for (int i = 0; i < cnt_prime; ++i)
    if (n % prime[i] == 0) {
      while (n % prime[i] == 0)
        n /= prime[i], ++p[i], v.push_back(prime[i] - 1);
      if (n == 1) break;
    }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() / 2; ++i) swap(v[i], v[v.size() - i - 1]);
  for (int i = v.size() - 1; i >= 0; --i)
    for (int j = i - 1; j >= 0; --j)
      if (pow(prime[j], v[j] + 1) < prime[i]) {
        v[j] = v[i] * v[j] + v[i] + v[j];
        v[i] = 0;
        break;
      }
  long long ans = 1;
  ;
  for (int i = 0; i < v.size(); ++i) ans *= f(prime[i], v[i]);
  printf("%I64d\n", ans);
  return 0;
}
