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;
const int MAXN = 1010;
const long long inf = 1e18;
vector<int> prime;
bool nprime[MAXN * MAXN];
int N;
long long dn[MAXN];
long long pw(long long a, long long b) {
  long long res = 1LL;
  for (; b; b >>= 1, a *= a) {
    if (b & 1) {
      res *= a;
      if (res > 1e18 || res < 0) return -1;
    }
    if (a > 1e18 || res < 0) return -1;
  }
  return res;
}
int main() {
  for (int(i) = (2); (i) < (MAXN * MAXN); (i)++)
    if (!nprime[i]) {
      prime.push_back(i);
      if (prime.size() == 30) break;
      for (int j = i + i; j < MAXN * MAXN; j += i) nprime[j] = true;
    }
  cin >> N;
  for (int(i) = (0); (i) < (MAXN); (i)++) dn[i] = inf;
  dn[1] = 1;
  for (int(j) = (0); (j) < (prime.size()); (j)++)
    for (int(i) = (N); (i) >= (1); (i)--)
      for (int k = 1; (k + 1) * i <= N && pw(prime[j], k) != -1 &&
                      pw(prime[j], k) * dn[i] > 0;
           k++)
        if (dn[i] != inf)
          dn[i * (k + 1)] = min(dn[i * (k + 1)], dn[i] * pw(prime[j], k));
  cout << dn[N] << endl;
  return 0;
}
