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 INF = 0x3f3f3f3f;
const double EPS = 1e-10;
const int MOD = 1000000007;
const int MAXN = 110000;
const double PI = acos(-1.0);
template <class T>
T abs(T x) {
  return x < 0 ? -x : x;
}
long long n;
int p[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
long long ans = 0;
void dfs(long long num, long long index, long long pre, long long cnt) {
  if (cnt > n || num > ans) return;
  if (cnt == n) {
    if (num < ans) ans = num;
    return;
  }
  long long t = p[index];
  for (int i = 1; i <= pre; i++) {
    if (num > ans / t || cnt > n / (i + 1)) break;
    dfs(num * t, index + 1, i, cnt * (i + 1));
    t *= p[index];
  }
}
int main() {
  while (cin >> n) {
    ans = 1e18 + 10;
    dfs(1, 0, 64, 1);
    cout << ans << endl;
  }
  return 0;
}
