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 pt(long long x) {
  int i = 2;
  while (x != 1) {
    while (x % i == 0) {
      cout << i << " ";
      x /= i;
    }
    i++;
  }
}
unsigned long long poww(int a, int m) {
  if (m == 0) return 1;
  if (m == 1) return a;
  unsigned long long t = poww(a, m / 2);
  t = t * t;
  if (m % 2 == 0)
    return t;
  else
    return t * a;
}
int nt[32000], na = 0;
int isP[32000 + 5];
void sang() {
  for (int i = 2; i <= 32000; i++) {
    if (isP[i] == 0) {
      nt[++na] = i;
      for (int j = 2 * i; j <= 32000; j += i) {
        isP[j] = 1;
      }
    }
  }
}
int p;
int res[100000];
unsigned long long ans = 2e24;
void bt(int i, int x) {
  for (int j = res[i - 1]; j >= 2; j--) {
    if (p % j == 0) {
      p /= j;
      res[i] = j;
      if (p == 1) {
        unsigned long long tmp = 1;
        for (int k = 1; k <= i; k++) {
          tmp *= poww(nt[k], res[k] - 1);
        }
        if (tmp == 0) tmp = 2e24;
        ans = min(ans, tmp);
      } else
        bt(i + 1, x);
      p *= j;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1;
    exit(0);
  }
  sang();
  p = n;
  res[0] = n;
  bt(1, n);
  cout << ans;
  cout << endl;
}
