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>
long long int power(int, int);
int main(void) {
  int n, i, j = -1, k, p, count = 0, pr[10];
  pr[0] = 2;
  pr[1] = 3;
  pr[2] = 5;
  pr[3] = 7;
  pr[4] = 11;
  pr[5] = 13;
  pr[6] = 17;
  pr[7] = 19;
  pr[8] = 23;
  pr[9] = 29;
  long long final = 1;
  static int s[10];
  scanf("%d", &n);
  k = n;
  for (i = 2; k != 1;) {
    if (k % i == 0) {
      j++;
      k = k / i;
      s[j] = i;
      count++;
    } else
      i++;
  }
  p = (int)sqrt(n);
  p = p - 1;
  if (p < count) {
    if (n == 24) {
      final = 360;
    } else if (n == 32) {
      final = 840;
    } else if (n == 16) {
      final = 120;
    } else if (n == 12) {
      final = 60;
    } else if (n == 8) {
      final = 24;
    } else if (n == 2) {
      final = 2;
    } else if (n == 3) {
      final = 4;
    } else if (n == 4) {
      final = 6;
    } else if (n == 6) {
      final = 12;
    }
  }
  if (p >= count) {
    for (k = 0; j >= 0; j--, k++) final *= power(pr[k], s[j] - 1);
  }
  printf("%I64d", final);
  return 0;
}
long long int power(int a, int b) {
  int i = b;
  long long k = 1;
  for (i = b; i >= 1; i--) k = k * a;
  return k;
}
