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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const unsigned long long MOD = 1e9 + 7;
const int N = 1005;
const unsigned long long MAX = 1e18;
unsigned long long prime[11] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
unsigned long long dp[N][15], mi[15][N], ans;
int n;
unsigned long long cal(unsigned long long c, unsigned long long a,
                       unsigned long long b) {
  double ans = 1.0 * c * mi[a][b];
  if (ans > MAX) return MAX;
  return c * mi[a][b];
}
void work() {
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= 10; j++) dp[i][j] = MAX;
  dp[1][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 10; j++) {
      for (int k = 1; k <= i; k++)
        if (i % k == 0)
          dp[i][j] = min(dp[i][j], cal(dp[i / k][j - 1], j, k - 1));
    }
  ans = dp[n][10];
}
void prepare() {
  for (int i = 1; i <= 10; i++) {
    mi[i][0] = 1;
    for (int j = 1; j <= 1000; j++) {
      mi[i][j] = mi[i][j - 1] * prime[i];
      if (mi[i][j] > MAX) mi[i][j] = MAX;
    }
  }
}
int main() {
  scanf("%d", &n);
  prepare();
  work();
  cout << ans << endl;
}
