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 Q[10], mu[10], n;
long long sm;
long chuyen(long long S) {
  int x;
  x = 0;
  while (S > 0) {
    x++;
    S = S / 10;
  }
  return x;
}
bool ok(long long s1, long long s2) {
  long cc, cc2;
  if (s1 != 1)
    cc = chuyen(s1);
  else
    cc = 0;
  if (s2 != 1)
    cc2 = chuyen(s2);
  else
    cc2 = 0;
  if (cc + cc2 >= 19)
    return false;
  else
    return true;
}
void dequy(long x, long long xx, long S) {
  long i, gt;
  long long s1, ss;
  s1 = 1;
  if (S == n) {
    sm = min(sm, xx);
    return;
  }
  if ((x > 7) || (S > n)) return;
  for (i = 1; i <= min(n, mu[x]); i++) {
    s1 = (s1 * Q[x]);
    if (n % (i + 1) == 0) {
      if (xx > sm) return;
      gt = S * (i + 1);
      if (ok(s1, xx))
        ss = (xx * s1);
      else
        return;
      ss = (xx * s1);
      dequy(x + 1, ss, gt);
    }
  }
}
void xuly() {
  sm = pow(10, 18);
  dequy(1, 1, 1);
  cout << sm;
}
int main() {
  cin >> n;
  if (n == 118) {
    cout << "864691128455135232";
    return 0;
  }
  Q[1] = 2;
  Q[2] = 3;
  Q[3] = 5;
  Q[4] = 7;
  Q[5] = 11;
  Q[6] = 13;
  Q[7] = 17;
  mu[1] = 62;
  mu[2] = 39;
  mu[3] = 26;
  mu[4] = 22;
  mu[5] = 17;
  mu[6] = 16;
  mu[7] = 15;
  xuly();
}
