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;
void fail(string s) {
  cout << s;
  exit(0);
}
void fail(long long s) {
  cout << s;
  exit(0);
}
vector<long long> v[50];
map<long long, long long> Mp;
long long ans;
void mx(long long cur_mx, long long nn, long long cur_pri, long long cur_val) {
  if (cur_val >= ans) return;
  for (long long i = min(cur_mx, nn / 2); i > 1; i--) {
    if (v[cur_pri][i - 1] < 0) continue;
    if (nn % i == 0) {
      if (1000000000000000000 / cur_val >= v[cur_pri][i - 1]) {
        mx(i, nn / i, Mp[cur_pri], cur_val * v[cur_pri][i - 1]);
      }
    }
  }
  if (nn <= cur_mx && v[cur_pri][nn - 1] > 0) {
    if (1000000000000000000 / cur_val >= v[cur_pri][nn - 1]) {
      if (cur_val * v[cur_pri][nn - 1] < ans)
        ans = cur_val * v[cur_pri][nn - 1];
    }
  }
}
void run(long long n) {
  ans = 1000000000000000009;
  mx(n, n, 2, 1);
  cout << ans << '\n';
}
signed main() {
  Mp[2] = 3, Mp[3] = 5, Mp[5] = 7;
  Mp[7] = 11, Mp[11] = 13, Mp[13] = 17;
  Mp[17] = 19, Mp[19] = 23, Mp[23] = 29;
  Mp[29] = 31, Mp[31] = 37, Mp[37] = 10000000;
  long long i = 2;
  while (i < 40) {
    v[i].push_back(1);
    for (long long j = (0); j < (1050); j++) {
      if (1000000000000000000 / i < v[i][j] || v[i][j] == -1)
        v[i].push_back(-1);
      else
        v[i].push_back(v[i][j] * i);
    }
    i = Mp[i];
  }
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    run(n);
  }
  return 0;
}
