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>
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int MAX = 5e2 + 5;
const long long MAX2 = 11;
const long long MOD = 998244353;
const long long MOD2 = 2010405347;
const long long INF = 2e18;
const int dr[] = {-1, 0, 1, 0, 1, 1, -1, -1, 0};
const int dc[] = {0, -1, 0, 1, 1, -1, 1, -1, 0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 320;
long long tc, n, m,
    p[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47}, k = 15, ans;
__int128 bt, nw;
void bf(int pos, int ls, long long rem) {
  if (rem == 1) {
    if (ans == -1)
      ans = nw;
    else
      ans = min(ans, (long long)nw);
    return;
  }
  if (pos == k) return;
  __int128 mul = 1;
  ls = min((long long)ls, rem);
  for (long long i = 2; i <= ls; ++i) {
    mul *= p[pos];
    if (mul * nw > bt) break;
    if (rem % i == 0) nw *= mul, bf(pos + 1, i, rem / i), nw /= mul;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  m = 1000000000000000000;
  ans = -1;
  bt = m, nw = 1;
  bf(0, 61, n);
  cout << ans << '\n';
  return 0;
}
