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 int prime[6000000] = {0}, numprime = 0;
bool isNotPrime[10000010] = {1, 1};
void sushu(int N) {
  long long int i;
  for (i = 2; i <= N; i++) {
    if (!isNotPrime[i]) prime[numprime++] = i;
    for (long j = 0; j < numprime && i * prime[j] < N; j++) {
      isNotPrime[i * prime[j]] = 1;
      if (!(i % prime[j])) break;
    }
  }
}
long long n;
long long ans = 1e18;
void find(long long sum, long long sign, long long k, long long p) {
  long long i;
  if (k == n) {
    ans = min(sum, ans);
    return;
  }
  if (k > n) return;
  long long now = sum;
  for (i = 1; i <= p; i++)
    if (now < (1e18) / prime[sign]) {
      now = now * prime[sign];
      find(now, sign + 1, k * (i + 1), i);
    }
}
int main() {
  sushu(200000);
  scanf("%lld", &n);
  find(1, 0, 1, 64);
  printf("%lld\n", ans);
}
