#include <bits/stdc++.h>
using namespace std;
vector<int> dv(200001);
void init() {
  for (int i = 1; i <= 200000; i++) {
    dv[i] = i;
  }
  for (int i = 2; i <= 200000; i++) {
    if (dv[i] == i) {
      for (int j = i; j <= 200000; j += i) {
        dv[j] = i;
      }
    }
  }
}
vector<int> p[200001];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  init();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    while (x > 1) {
      int g = dv[x], pw = 0;
      while (x % g == 0) {
        x /= g;
        pw++;
      }
      p[g].push_back(pw);
    }
  }
  long long ans = 1;
  for (int i = 2; i <= 200000; i++) {
    if (p[i].size() < n - 1) continue;
    sort(p[i].begin(), p[i].end());
    int pp;
    if (p[i].size() == n - 1)
      pp = p[i][0];
    else
      pp = p[i][1];
    while (pp--) {
      ans *= i;
    }
  }
  cout << ans << '\n';
  return 0;
}
