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 prime[16] = {2,  3,  5,  7,  11, 13, 17, 19,
                       23, 29, 31, 37, 41, 43, 47, 53};
const int lmlog[16] = {59, 37, 25, 21, 17, 16, 14, 14,
                       13, 12, 12, 11, 11, 11, 10, 10};
const int maxN = 1000;
const unsigned long long oo = 1000000000000000001;
int n;
unsigned long long ppow[16][60];
unsigned long long f[maxN + 1][17];
int main() {
  cin >> n;
  int i, j, k;
  for (i = 0; i < 16; ++i) {
    ppow[i][0] = 1;
    for (j = 1; j <= lmlog[i]; ++j) ppow[i][j] = ppow[i][j - 1] * prime[i];
  }
  for (i = 1; i <= n; ++i) f[i][0] = oo;
  for (i = 0; i <= 16; ++i) f[1][i] = 1;
  for (j = 1; j <= 16; ++j)
    for (i = 2; i <= n; ++i) {
      f[i][j] = f[i][j - 1];
      for (k = 1; k < lmlog[j - 1]; ++k)
        if (i % (k + 1) == 0 && f[i / (k + 1)][j - 1] < oo &&
            f[i / (k + 1)][j - 1] < oo / ppow[j - 1][k])
          f[i][j] = min(f[i][j], f[i / (k + 1)][j - 1] * ppow[j - 1][k]);
    }
  cout << f[n][16];
}
