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 main() {
  long long n;
  cin >> n;
  vector<long long> v;
  long long x = n, z = 2;
  long long p[20];
  for (long long k = 0; k <= 19; k++) {
    p[k] = z;
    z++;
    while (true) {
      long long j = 0;
      for (long long r = 2; r < z; r++) {
        if (z % r == 0) {
          j = 1;
          break;
        }
      }
      if (j == 1)
        z++;
      else
        break;
    }
  }
  z = 2;
  while (x != 1) {
    while (x % z == 0) {
      x /= z;
      v.push_back(z - 1);
    }
    z++;
  }
  sort(v.begin(), v.end(), greater<long long>());
  long long cnt = 1;
  long long rw = 0;
  if (v.size() >= 3) {
    if (v[0] == v[1] && v[0] == v[2] && v[0] == 1) {
      rw = 2;
      cnt = 8;
      for (long long k = 2; k < v.size(); k++) {
        while (v[k]--) cnt *= p[k - 1];
      }
      cout << cnt;
      return 0;
    }
  }
  for (long long k = 0; k < v.size(); k++) {
    while (v[k]--) cnt *= p[k];
  }
  cout << cnt;
  return 0;
}
