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 MAX = 1000000000000000000LL;
long long ret = MAX + 1;
int primes[60];
bool isPrime[10000 + 1];
int n;
void sieve() {
  memset(isPrime, 1, 10000);
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i * i <= 10000; i++)
    if (isPrime[i])
      for (int j = i * i; j <= 10000; j += i) isPrime[j] = false;
  int c = 0;
  for (int i = 2; c <= 60; i++) {
    if (isPrime[i]) primes[c++] = i;
  }
}
void f(int index, long long numSoFar, long long divSoFar) {
  if (divSoFar > n || index >= 60 || numSoFar > ret) return;
  if (divSoFar == n) {
    if (numSoFar < ret) ret = numSoFar;
    return;
  }
  long long previous = numSoFar;
  long long next;
  for (int i = 1; i <= 60; i++) {
    next = previous * primes[index];
    if (next / primes[index] != previous) return;
    if ((n / divSoFar) % (i + 1) == 0) f(index + 1, next, divSoFar * (i + 1));
    previous = next;
  }
}
int main() {
  sieve();
  cin >> n;
  f(0, 1, 1);
  cout << ret;
}
