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 long prime[100005];
void sieve() {
  prime[1] = 0;
  for (long long i = 2; i <= 100000; i++)
    if (prime[i]) {
      for (long long j = 2 * i; j <= 100000; j += i) prime[j] = false;
    }
}
int main() {
  long long n;
  cin >> n;
  long long dp[n + 1][11];
  long long prime[11] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
  for (long long i = 0; i <= 10; i++) dp[1][i] = 1;
  for (long long i = 2; i <= n; i++) dp[i][0] = 1e18;
  for (long long i = 2; i <= n; i++)
    for (long long j = 1; j <= 10; j++) {
      dp[i][j] = 1e18;
      for (long long k = 0, val = 1; val <= 1e18; k++, val *= prime[j]) {
        if (i % (k + 1) == 0 && (i / (k + 1)) >= 1) {
          long long x = 1e18;
          if (dp[i / (k + 1)][j - 1] != 1e18) x = dp[i / (k + 1)][j - 1] * val;
          if (x < 0) x = 1e18;
          dp[i][j] = min(dp[i][j], x);
        }
      }
    }
  cout << dp[n][10];
  return 0;
}
