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 int ns = 49000, top = 15;
const long long INF = ((long long)1 << 62) + 1;
long long ans;
int m, k, cnt;
int p[100] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
void dfs(int fm, long long t, int pos) {
  if (fm == k && ans > t) ans = t;
  if (fm >= k || (pos >= top)) return;
  for (int i = 1; i <= 62; i++) {
    if (t > ans / p[pos] || fm * (i + 1) > k) break;
    t *= p[pos];
    if (k % (fm * (i + 1)) == 0) dfs(fm * (i + 1), t, pos + 1);
  }
}
int main() {
  int T, cas = 0;
  while (cin >> k) {
    ans = INF;
    dfs(1, 1, 0);
    printf("%I64d\n", ans);
  }
  return 0;
}
