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;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxp = 30;
long long ans;
int cnt;
bool tag[maxp];
int prim[maxp];
void GetPrim() {
  cnt = 0;
  for (int i = 2; i < maxp; i++) {
    if (!tag[i]) {
      prim[cnt++] = i;
      for (int j = i + i; j < maxp; j += i) {
        tag[j] = 1;
      }
    }
  }
}
void dfs(int deep, long long num, int cur, int need) {
  if (need % cur != 0 || deep >= cnt) {
    return;
  }
  if (cur == need) {
    ans = num;
    return;
  }
  for (int i = 1; i <= 60; i++) {
    dfs(deep + 1, num, cur * i, need);
    if (ans / prim[deep] < num) return;
    num *= prim[deep];
  }
}
int main() {
  GetPrim();
  int n;
  scanf("%d", &n);
  ans = INF;
  dfs(0, 1, 1, n);
  printf("%I64d\n", ans);
  return 0;
}
