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 prime[] = {2,  3,  5,  7,  11, 13, 17, 19, 23,
                     29, 31, 37, 41, 43, 47, 53, 59};
vector<long long> v;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, s = 1, s1 = 1, sn;
  cin >> n;
  sn = n;
  map<long long, long long> m;
  for (long long i = 2; i < 60; i++) {
    while (n % i == 0) {
      m[i]++;
      v.push_back(i);
      n /= i;
    }
  }
  reverse(v.begin(), v.end());
  for (long long i = 0; i < v.size(); i++) {
    for (long long j = 0; j < v[i] - 1; j++) s *= prime[i];
  }
  sort(v.begin(), v.end());
  if (sn % 4 == 0 && m.size() == 1) {
    v[0] = 1;
    v[1] = 4;
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    for (long long i = 0; i < v.size(); i++) {
      for (long long j = 0; j < v[i] - 1; j++) s1 *= prime[i];
    }
    s = min(s1, s);
  }
  cout << s;
}
