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 = 0x3f3f3f3f3f3f3f3f, up = 1e18;
inline int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int prime[10] = {99999999, 2, 3, 5, 7, 11, 13, 17, 19, 23};
long long dp[10][1001];
int main() {
  memset(dp, 0x3f, sizeof dp);
  dp[0][1] = 1;
  int n = read();
  for (int i = 1; i <= 9; ++i)
    for (int j = 1; j <= n; ++j) {
      long long tt = 1;
      dp[i][j] = dp[i - 1][j];
      for (int k = 1; k < 1000; ++k) {
        if (up / prime[i] < tt) break;
        tt *= prime[i];
        if (j % (k + 1) == 0)
          if (dp[i][j] / tt >= dp[i - 1][j / (k + 1)])
            dp[i][j] = dp[i - 1][j / (k + 1)] * tt;
      }
    }
  printf("%lld\n", dp[9][n]);
  return 0;
}
