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;
using ll = long long;
const int maxn = 1e3 + 10;
const int maxb = 110;
const int inf = 1e9;
const __int128 Inf = 1e20;
int T = 1, n;
__int128 ans = 0, prime[15] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
void dfs(__int128 primeid, __int128 now, int cnt) {
  if (primeid > 10) return;
  if (cnt == n) {
    ans = min(ans, now);
    return;
  }
  if (cnt > n) return;
  for (int i = 1; i <= 64; ++i) {
    now *= prime[primeid];
    if (now > ans) break;
    dfs(primeid + 1, now, cnt * (i + 1));
  }
}
int main() {
  __int128 a = 1ll;
  while (T--) {
    ans = Inf;
    scanf("%d", &n);
    dfs(a, a, a);
    printf("%lld\n", ll(ans));
  }
  return 0;
}
