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;
const int INF = 0x3f3f3f3f;
const int MAX = 1000;
const int SIZE = MAX + 5;
bool p[SIZE];
vector<int> l;
long long po[SIZE][SIZE];
long long ans = 1e18;
void go(int r, long long ansl, int p) {
  if (ansl > 1e18 || ansl <= 0) return;
  if (r == 1) {
    ans = min(ans, ansl);
  } else {
    if (ansl >= ans) return;
    if (p >= l.size()) return;
    for (int i = 2; i <= min(MAX, r); i++)
      if (r % i == 0 && po[p][i - 1] != 0) {
        go(r / i, ansl * po[p][i - 1], p + 1);
      }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  memset(p, true, sizeof(p));
  p[0] = p[1] = false;
  for (int i = 2; i <= MAX; i++)
    if (p[i]) {
      l.push_back(i);
      for (int j = i + i; j <= MAX; j += i) {
        p[j] = false;
      }
    }
  for (int i = 0; i < l.size(); i++) {
    po[i][0] = 1;
    for (int j = 1; j <= MAX; j++) {
      po[i][j] = po[i][j - 1] * l[i];
      if (po[i][j] > 1e18 || po[i][j] <= 0) {
        po[i][j] = 0;
        break;
      }
    }
  }
  go(n, 1, 0);
  printf("%I64d\n", ans);
  return 0;
}
