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>
const long long mx = (long long)1e18;
using namespace std;
bool q[100];
int p[100];
long long d[100][1001];
long long go(int at, int n) {
  if (n == 1) return 1;
  long long &res = d[at][n];
  if (res == -1) {
    res = mx;
    long long s = 1;
    for (int i = 1; i <= n; i++) {
      if (s > res / p[at]) break;
      s *= p[at];
      if (n % (i + 1) == 0) {
        long long got = go(at + 1, n / (i + 1));
        if (got <= res / s)
          if (got * s <= res) res = got * s;
      }
    }
  }
  return res;
}
int main() {
  int n, i, j;
  memset(q, true, sizeof(q));
  q[1] = 0;
  for (i = 2; i < 100; i++)
    if (q[i])
      for (j = i * i; j < 100; j += i) q[j] = 0;
  int cnt = 0;
  for (i = 2; i < 100; i++)
    if (q[i]) p[cnt++] = i;
  memset(d, -1, sizeof(d));
  while (~scanf("%d", &n)) printf("%I64d\n", go(0, n));
  return 0;
}
