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;
long long prim[17] = {0,  2,  3,  5,  7,  11, 13, 17, 19,
                      23, 29, 31, 37, 41, 43, 47, 53};
long long n, ans = (long long)1e18;
inline long long getint() {
  long long w = 0, q = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') q = 1, c = getchar();
  while (c >= '0' && c <= '9') w = w * 10 + c - '0', c = getchar();
  return q ? -w : w;
}
void dfs(long long val, long long div, long long pos, long long la) {
  if (div == n) {
    ans = min(ans, val);
    return;
  }
  if (pos > 16 || val > (long long)(1e18) || val <= 0 || div > n || val >= ans)
    return;
  for (long long i = 0; val <= (long long)(1e18) && val > 0 && i <= la;
       val *= prim[pos], i++)
    dfs(val, div * (i + 1), pos + 1, i);
}
int main() {
  cin >> n;
  dfs(1, 1, 1, 1000);
  cout << ans;
  return 0;
}
