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;
using ll = long long;
const ll inf = 2e10;
ll bigmod(ll a, ll b) {
  if (b == 0) return 1;
  ll x = bigmod(a, b / 2);
  x = x * x;
  if (b & 1) x = a * x;
  return x;
}
vector<ll> v, prime;
ll spf[1000005];
void pre() {
  for (ll i = 0; i < 1000005; i++) spf[i] = i;
  for (ll i = 2; i * i < 1000005; i++) {
    if (spf[i] == i) {
      for (ll j = 2 * i; j < 1000005; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
  for (ll i = 2; i < 1000005; i++)
    if (spf[i] == i) prime.push_back(i);
  return;
}
void factorize(int n) {
  while (n > 1) {
    v.push_back(spf[n]);
    n /= spf[n];
  }
  sort(v.begin(), v.end(), greater<ll>());
  return;
}
void solve() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1;
    return;
  }
  pre();
  factorize(n);
  ll now = n / spf[n], ans = 1;
  if (now < spf[n]) swap(now, spf[n]);
  if (n < 10)
    ans = bigmod(2, now - 1) * bigmod(3, spf[n] - 1);
  else {
    for (ll i = 0; i < v.size(); i++) ans *= bigmod(prime[i], v[i] - 1);
  }
  cout << ans;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << '\n';
  return 0;
}
