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>
int n, p[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 27};
long long f[1050];
int main() {
  scanf("%d", &n);
  f[1] = 1;
  for (int i = 2; i <= n; i++) f[i] = 1e18;
  long long k = 2;
  for (int i = 2; i <= n; i++)
    if (f[i] > k)
      f[i] = k, k *= 2;
    else
      break;
  for (int i = 1; i <= 9; i++)
    for (int j = n; j >= 1; j--) {
      long long pow = p[i];
      for (int k = 1; k <= 64; k++) {
        long long t1 = pow * f[j], t2 = j * (k + 1);
        if (t1 > 1e18 || t1 < 0 || t2 > 1000) break;
        if (f[t2] > t1) f[t2] = t1;
        pow *= p[i];
      }
    }
  printf("%I64d\n", f[n]);
}
