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 n;
long long mx = 1e18;
vector<long long> v;
bool pr[1000005];
void sieve() {
  pr[0] = 1;
  pr[1] = 1;
  for (int i = 2; i * i <= 1000000; i++) {
    if (!pr[i]) {
      for (int j = i + i; j <= 1000000; j += i) pr[j] = 1;
    }
  }
  for (int i = 2; i <= 1000000; i++) {
    if (!pr[i]) v.push_back(i);
  }
}
long long mem[100][1004];
long long dp(int i, int divs) {
  if (i >= 90) return 1e18;
  if (divs > n) return 1e18;
  if (divs == n) return 1;
  if (mem[i][divs] != -1) return mem[i][divs];
  long long ret = 1e18;
  long long u = v[i];
  long long o = 1;
  for (int j = 1; j < 62; j++) {
    o *= u;
    long long ne = j + (j * divs);
    long long x = dp(i + 1, divs + ne);
    if (x == 1e18) continue;
    long long p = x * o;
    if (p < 1 || p / x != o) continue;
    ret = min(ret, p);
  }
  return mem[i][divs] = ret;
}
int main() {
  cin >> n;
  n--;
  if (!n)
    cout << 1 << endl;
  else {
    sieve();
    memset(mem, -1, sizeof mem);
    cout << dp(0, 0) << endl;
  }
  return 0;
}
