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;
int num;
long long a[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
long long dp[17][1002][66];
long long call(int pos, int div, int last, long long carry) {
  if (pos == 15) return (div == num) ? 1 : 2e18;
  if (dp[pos][div][last] != -1) return dp[pos][div][last];
  long long res = 2e18;
  long long value = 1;
  for (int i = 0; i <= last; i++) {
    if ((i + 1) * div <= num) {
      long long extra = 1e18 / carry;
      if (extra >= value) {
        long long temp = call(pos + 1, div * (i + 1), i, value * carry);
        if (temp != 2e18) {
          res = min(res, value * temp);
        }
      }
    } else
      break;
    value *= a[pos];
  }
  return dp[pos][div][last] = res;
}
int main(void) {
  memset(dp, -1, sizeof dp);
  scanf("%d", &num);
  long long ans = call(0, 1, 62, 1);
  printf("%lld\n", ans);
  return 0;
}
