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;
constexpr int N = 1000 + 10;
constexpr long long INF = 1e18;
long long n, dp[40][N],
    prime[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 34, 37, 41, 43},
    pw[100][100];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < 15; i++) {
    pw[i][0] = 1;
    for (int j = 1; prime[i] <= (INF / pw[i][j - 1]); j++)
      pw[i][j] = pw[i][j - 1] * prime[i];
  }
  memset(dp, 63, sizeof(dp));
  dp[0][1] = 1;
  for (int i = 1; i <= 15; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 0; pw[i - 1][k]; k++)
        if (dp[i - 1][j / (k + 1)] != 4557430888798830399ll && !(j % (k + 1)) &&
            (pw[i - 1][k] <= (INF / dp[i - 1][j / (k + 1)])))
          dp[i][j] = min(dp[i][j], dp[i - 1][j / (k + 1)] * pw[i - 1][k]);
  cout << dp[15][n] << '\n';
  return 0;
}
