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;
int prim(int a) {
  if (a < 2) return 0;
  if (a == 2) return 1;
  if (a % 2 == 0) return 0;
  for (int i = 3; i * i <= a; i += 2)
    if (a % i == 0) return 0;
  return 1;
}
void rezolvare(long long n) {
  vector<long long> a;
  long long i = 2, p = 1, j = 2;
  while (n > 1) {
    while (n % i == 0) n /= i, a.push_back(i);
    i++;
  }
  for (i = (long long)a.size() - 1; i >= 0; i--) {
    p *= pow(j, a[i] - 1);
    j++;
    if (a[a.size() - 1] > 2)
      while (!prim(j)) j++;
  }
  cout << p;
}
int main() {
  long long n;
  cin >> n;
  rezolvare(n);
  return 0;
}
