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 unsigned long long maxn = 1e3 + 10, midn = 10, lg = 60, INF = 2e18;
unsigned long long dp[maxn][midn];
vector<unsigned long long> prime = {2, 3, 5, 7, 11, 13, 17, 19, 23};
inline unsigned long long power(unsigned long long a, int b) {
  unsigned long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = min(INF, 1ll * ans * a);
    }
    a = min(1ll * a * a, INF);
    b /= 2;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < maxn; ++i) {
    for (int j = 1; j < 10; ++j) {
      dp[i][j] = INF;
    }
  }
  dp[1][0] = 1;
  for (int j = 1; j < 10; ++j) {
    dp[1][j] = 1;
    dp[2][j] = 2;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < 10; ++j) {
      if (j == 1) {
        if (i - 1 <= 60)
          dp[i][j] = power(2, i - 1);
        else
          dp[i][j] = INF;
        continue;
      }
      long long p = 1;
      dp[i][j] = dp[i][j - 1];
      for (int k = 0; k <= 60; ++k) {
        if (i % (k + 1) == 0) {
          if (INF / dp[i / (k + 1)][j - 1] >= p) {
            dp[i][j] = min(dp[i][j], dp[i / (k + 1)][j - 1] * p);
          }
        }
        if (INF / p < prime[j - 1]) {
          break;
        }
        p *= prime[j - 1];
      }
    }
  }
  cout << dp[n][9] << endl;
}
