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;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
std::vector<long long int> v[200009];
long long int cnt, ans;
std::vector<long long int> v2 = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
void solve(long long int val, vector<long long int> v1) {
  if (val == 1) {
    sort(v1.begin(), v1.end());
    long long int a = v1.size() - 1;
    long long int sum = 1;
    for (int i = a; i >= 0; i--) {
      while (v1[i] > 1) {
        sum *= v2[a - i], v1[i]--;
        if (sum <= 0 || sum >= 1e18 + 1) return;
      }
    }
    ans = min(ans, sum);
    return;
  }
  for (long long int i = 2; i <= val; i++) {
    if (val % i == 0) {
      v1.push_back(i);
      solve(val / i, v1);
      if (v1.size()) v1.pop_back();
    }
  }
  return;
}
int main() {
  int test_case = 1;
  for (int cs = 1; cs <= test_case; cs++) {
    long long int n;
    scanf("%lld", &n);
    if (n == 1) {
      printf("1\n");
      continue;
    }
    std::vector<long long int> v1;
    ans = 1e18 + 1;
    solve(n, v1);
    printf("%lld\n", ans);
  }
  return 0;
}
