#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> m(200000);
  int nn = n + 1;
  while (--nn) {
    int tmp;
    cin >> tmp;
    for (int i = 2; i * i <= tmp; ++i) {
      int k = 0;
      while (tmp % i == 0) {
        tmp /= i;
        ++k;
      }
      if (k != 0) {
        m[i].push_back(k);
      }
    }
    if (tmp != 1) {
      m[tmp].push_back(1);
    }
  }
  long long res = 1;
  for (int i = 0; i < 200000; ++i) {
    if (m[i].size() < n - 1) {
      continue;
    }
    sort(m[i].begin(), m[i].end());
    int power;
    if (m[i].size() == n - 1) {
      power = m[i][0];
    } else {
      power = m[i][1];
    }
    while (power--) {
      res *= i;
    }
  }
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
