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;
bool status[5000000];
long long int arr[1010];
int cnt;
void siv() {
  int N = 100;
  int sq = sqrt(N);
  for (int i = 4; i <= N; i += 2) status[i] = 1;
  for (int i = 3; i <= sq; i += 2) {
    if (status[i] == 0) {
      for (int j = i * i; j <= N; j += i) status[j] = 1;
    }
  }
  status[1] = 1;
}
long long int dp[50][1010], ans;
bool vis[1010][1010];
int n, k;
void cal(int pos, int tot, long long int val) {
  if (pos > cnt) return;
  if (tot == k) ans = min(ans, val);
  long long int i, tmp;
  tmp = 1;
  for (i = 1; i <= 62; i++) {
    tmp *= arr[pos];
    if (tmp * val <= ans and (tot) * (i + 1) <= k) {
      cal(pos + 1, (tot) * (i + 1), tmp * val);
    } else
      break;
  }
}
int main() {
  siv();
  int i;
  cnt = 1;
  for (i = 1; i <= 70; i++) {
    if (status[i] == 0) {
      arr[cnt] = i;
      cnt++;
    }
  }
  ans = 3e18;
  memset(vis, 0, sizeof vis);
  cin >> k;
  cal(1, 1, 1);
  cout << ans << endl;
}
