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 p[15] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
long long ans = 1000000000000000000ll;
long long ksm(long long a, int b, long long c) {
  long long res = 1ll;
  while (b) {
    if (b & 1) {
      if (res > ans / c / a) return -1;
      res = res * a;
    }
    a = a * a;
    b >>= 1;
  }
  return res;
}
void dfs(int x, int y, int m, long long d) {
  if (m == 1) {
    ans = min(ans, d);
    return;
  }
  int i;
  for (i = 2; i <= min(m, y + 1); i++)
    if (m % i == 0) {
      if (ksm(p[x], i - 1, d) == -1) break;
      dfs(x + 1, i - 1, m / i, d * ksm(p[x], i - 1, d));
    }
  return;
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  dfs(1, 60, n, 1ll);
  cout << ans;
  return 0;
}
