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;
long long int minim = 1LL << 60;
bool check_prim(int num) {
  if (num < 2) return false;
  if (num == 2) return true;
  if (!(num % 2)) return false;
  for (int i = 3; i * i <= num; i += 2) {
    if (!(num % i)) return false;
  }
  return true;
}
void generate_prod(long long int val, long long int n,
                   vector<long long int> &prim, int k) {
  if ((val & (1LL << 63)) == (1LL << 63)) return;
  if (n == 1) {
    if (val < minim) minim = val;
    return;
  }
  for (int div_n = 2; div_n * div_n <= n; div_n++) {
    if (n % div_n == 0) {
      generate_prod(val * pow(prim[k], div_n - 1), n / div_n, prim, k + 1);
      generate_prod(val * pow(prim[k], n / div_n - 1), div_n, prim, k + 1);
    }
  }
  generate_prod(val * pow(prim[k], n - 1), 1, prim, k + 1);
}
int main() {
  int n;
  cin >> n;
  vector<long long int> prim;
  prim.push_back(2);
  for (int num = 3; prim.size() < 10; num += 2) {
    if (check_prim(num)) prim.push_back(num);
  }
  generate_prod(1, n, prim, 0);
  cout << minim << '\n';
  return 0;
}
