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;
bool isprime[1005];
int p[1005], idxP;
void init() {
  memset(isprime, true, sizeof isprime);
  for (int i = 2; i <= 1000; ++i) {
    if (isprime[i]) p[idxP++] = i;
    for (int j = 0; j < idxP; ++j) {
      int x = p[j] * i;
      if (x > 1000) break;
      isprime[x] = false;
      if (i % p[j] == 0) break;
    }
  }
}
void dfs(int pos, long long n, long long now, long long &ans) {
  if (n == 1) ans = min(ans, now);
  if (now >= ans || n <= 1) return;
  long long t = 1;
  for (int i = 1; i <= 62; ++i) {
    t *= p[pos];
    if (n < i + 1) break;
    if (n % (i + 1) == 0 && ans / t >= now)
      dfs(pos + 1, n / (i + 1), now * t, ans);
  }
}
int main() {
  init();
  int n;
  scanf("%d", &n);
  long long ans = 1LL << 60;
  dfs(0, n, 1, ans);
  printf("%lld\n", ans);
  return 0;
}
