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 = 1e5 + 5;
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long sq(long long x) { return (x * x) % MOD; }
long long modP(long long a, long long b) {
  return (!b ? 1 : (sq(modP(a, b / 2)) * (b % 2 ? a : 1)) % MOD);
}
long long ans = INF, n;
long long sP[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
void backtrack(int level = 0, long long numDiv = 1, long long x = 1) {
  if (numDiv > n) return;
  if (numDiv == n) {
    ans = min(ans, x);
    return;
  }
  if (level >= 10) return;
  for (int k = 1; k < 61 && ans >= x * sP[level]; k++) {
    x *= sP[level];
    backtrack(level + 1, numDiv * (k + 1), x);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  backtrack();
  cout << ans << endl;
  return 0;
}
