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 a[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31}, po[62][13],
          inf = LONG_LONG_MAX / 2;
long long f(long long pt, long long mx, long long n) {
  if (n == 1) return 1;
  long long ans = inf;
  for (long long i = 1; po[i][pt] != -1 and i <= mx and n >= (i + 1); i++) {
    if (n % (i + 1) == 0) {
      long long x = f(pt + 1, i, n / (i + 1));
      if (x != -1 and inf / x > (po[i][pt]))
        (ans) = min((ans), (x * po[i][pt]));
    }
  }
  if (ans == inf)
    return -1;
  else
    return ans;
}
int32_t main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < 11; i++) {
    po[0][i] = 1;
    long long cn = 1;
    while (inf / po[cn - 1][i] > a[i]) {
      po[cn][i] = po[cn - 1][i] * a[i];
      cn++;
    }
    po[cn][i] = -1;
  }
  cout << f(0, n - 1, n);
}
