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, ans[25], flag, cnt, temp[25];
int prim[20] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37};
long long res;
long long min(long long a, long long b) { return a < b ? a : b; }
long long mypow(int a, int b) {
  long long Ans = 1, INF = ((long long)1 << 62);
  for (int i = 1; i <= b; i++) {
    if (INF / Ans < a) return -1;
    Ans = Ans * (long long)a;
    if (res != -1 && Ans >= res) return -1;
  }
  return Ans;
}
void dfs(int step, int sum) {
  int i, j;
  long long Ans, INF = (long long)1 << 62;
  if (sum > n) return;
  if (sum == n) {
    for (i = 0; i < step; i++) temp[i] = ans[i];
    sort(temp, temp + step);
    Ans = 1;
    for (i = step - 1, j = 0; i >= 0; i--, j++) {
      long long tmp = mypow(prim[j], temp[i]);
      if (tmp == -1 || INF / Ans < tmp) return;
      Ans *= tmp;
    }
    if (res == -1)
      res = Ans;
    else
      res = min(res, Ans);
    return;
  }
  for (i = 1; i <= 64; i++) {
    if (sum * (i + 1) > n) break;
    ans[step] = i;
    dfs(step + 1, sum * (i + 1));
  }
}
int main() {
  int i;
  scanf("%d", &n);
  res = -1;
  dfs(0, 1);
  printf("%I64d\n", res);
  return 0;
}
