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 maxi = 1e18;
long long prime[] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
long long dp[15][1005], mi[15][1005], ans;
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int i = 1; i <= 10; i++) {
    mi[i][0] = 1;
    for (int j = 1; j <= 1000; j++) {
      long long temp;
      bool flag = __builtin_mul_overflow(mi[i][j - 1], prime[i], &temp);
      if (!flag)
        mi[i][j] = mi[i][j - 1] * prime[i];
      else
        mi[i][j] = maxi;
    }
  }
  int n;
  cin >> n;
  for (int i = 1; i <= 10; i++) {
    for (int j = 1; j <= n; j++) dp[i][j] = maxi;
  }
  for (int i = 1; i <= n; i++) dp[1][i] = mi[1][i - 1];
  for (int i = 2; i <= 10; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= j; k++) {
        if (j % k == 0) {
          long long temp;
          bool flag =
              __builtin_mul_overflow(dp[i - 1][j / k], mi[i][k - 1], &temp);
          if (!flag) dp[i][j] = min(dp[i][j], dp[i - 1][j / k] * mi[i][k - 1]);
        }
      }
    }
  }
  cout << dp[10][n] << "\n";
  return 0;
}
