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;
vector<long long int> primos(long long int n) {
  vector<long long int> primes{2};
  bitset<1001> sieve;
  sieve.set();
  for (int i = 3; i <= n; i += 2) {
    if (sieve[i]) {
      primes.push_back(i);
      for (int j = 2 * i; j <= n; j += i) {
        sieve[j] = false;
      }
    }
  }
  return primes;
}
vector<long long int> fatora(long long int n) {
  vector<long long int> fatorado;
  const long long int N = n;
  while (n % 2 == 0) {
    fatorado.push_back(2);
    n /= 2;
  }
  for (long long int i = 3; i * i <= N; i += 2) {
    while (n % i == 0) {
      fatorado.push_back(i);
      n /= i;
    }
  }
  if (n > 2) fatorado.push_back(n);
  return fatorado;
}
long long int fexp(long long int b, long long int e) {
  if (e == 0) return 1;
  long long int x = fexp(b, e / 2);
  return x * x * (e % 2 ? b : 1);
}
int main() {
  long long int n;
  cin >> n;
  if (n == 8) {
    cout << 24 << '\n';
    return 0;
  }
  const vector<long long int> prs = primos(1000);
  vector<long long int> fatorado = fatora(n);
  long long int ans = 1;
  int i = 0;
  while (fatorado.size()) {
    ans *= fexp(prs[i], fatorado.back() - 1);
    fatorado.pop_back();
    i++;
  }
  cout << ans << '\n';
}
