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 N = 14;
const int EXP = 60;
const long long limit = 1000000000000000000LL;
int P[N + 1];
unsigned long long A[14] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43};
unsigned long long F[14][EXP + 5];
unsigned long long num, ans, L, CA;
bool valid(unsigned long long a, unsigned long long b) {
  long double aa = a, bb = b;
  if (aa * bb > 1e18) return 0;
  return a * b <= limit;
}
bool valid2(int pos, int exp) {
  long double aa = A[pos], bb = exp;
  if (pow(aa, bb) > 1e18) return 0;
  return F[pos][exp] <= limit;
}
void f(int pos, int exp) {
  if (pos == N || exp == 0) {
    if (CA == L) ans = min(ans, num);
    return;
  }
  unsigned long long temp1 = num;
  unsigned long long temp2 = CA;
  f(pos, exp - 1);
  num = temp1;
  CA = temp2;
  temp1 = num;
  temp2 = CA;
  if (valid2(pos, exp) && valid(num, F[pos][exp]) && valid(CA, exp + 1)) {
    num *= F[pos][exp];
    CA *= (exp + 1);
    f(pos + 1, exp);
  }
  num = temp1;
  CA = temp2;
}
int main() {
  for (int i = 0; i < N; i++) F[i][0] = 1;
  for (int i = 0; i < N; i++)
    for (int k = 1; k <= EXP; ++k) F[i][k] = F[i][k - 1] * A[i];
  while (cin >> L) {
    CA = num = 1;
    ans = LLONG_MAX;
    f(0, EXP);
    cout << ans << '\n';
  }
}
