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 vector<long long> primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
void solve(const long long &d, long long n, const long long &i,
           const long long &K, long long &ans) {
  if (d == 1 && (!ans || n < ans))
    ans = n;
  else
    for (long long j = 1; j <= K; ++j) {
      n *= primes[i];
      if (n > 1e18 + 1) break;
      if (!(d % (j + 1))) solve(d / (j + 1), n, i + 1, j, ans);
    }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  long long d;
  long long ans = 0;
  cin >> d;
  solve(d, 1, 0, 60, ans);
  cout << ans;
  return 0;
}
