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 int block_size = 360;
const int maxn = 100010;
const long long mod = 1e9 + 7;
const long double eps = 1e-9;
const int inf = mod;
long long fast(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      b--;
      ans = ans * a;
    } else {
      a = a * a;
      b /= 2;
    }
  }
  return ans;
}
long long ps[] = {2,  3,  5,  7,  11, 13, 17, 19, 23,
                  29, 31, 37, 41, 43, 47, 53, 53};
long long target;
long long fans = 2e18;
void dfs(int cur, long long ans, long long cur_factor) {
  if (target % cur_factor != 0) {
    return;
  }
  if (cur_factor == target) {
    fans = min(fans, ans);
    return;
  }
  if (cur == 17) {
    return;
  }
  for (int i = 0; i < 70; i++) {
    long long new_ans = ans * fast(ps[cur], i);
    if (new_ans < ans || new_ans > fans) {
      break;
    } else {
      dfs(cur + 1, new_ans, cur_factor * (i + 1));
    }
  }
}
int main() {
  cin >> target;
  dfs(0, 1, 1);
  cout << fans;
  return 0;
}
