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 long long inf = 1e18 + 1;
long long dp[1001][11];
long long pri[] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
long long mxpow[] = {0, 59, 37, 25, 21, 17, 16, 14, 14, 13, 12};
long long Pow[11][60];
void Put() {
  for (int i = 0; i <= 1000; ++i)
    for (int j = 0; j <= 10; ++j) dp[i][j] = inf;
  for (int i = 1; i <= 10; ++i) {
    Pow[i][0] = 1;
    for (int j = 1; j <= mxpow[i]; ++j) {
      Pow[i][j] = Pow[i][j - 1] * pri[i];
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Put();
  int n;
  cin >> n;
  for (int i = 0; i <= 10; ++i) dp[1][i] = 1;
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j <= 10; ++j) {
      for (int k = 0; k <= mxpow[j]; ++k) {
        if (i % (k + 1) == 0 && dp[i / (k + 1)][j - 1] <= inf / Pow[j][k])
          dp[i][j] = min(dp[i][j], dp[i / (k + 1)][j - 1] * Pow[j][k]);
      }
    }
  }
  cout << dp[n][10];
  return 0;
}
