#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
long long int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int ans = 1;
  for (long long int i = 2; i <= 200000; i++) {
    while (1) {
      long long int cnt = 2;
      for (int j = 0; j < n; j++) {
        if (a[j] % i != 0) cnt--;
        if (cnt == 0) break;
      }
      if (cnt == 0) break;
      for (int j = 0; j < n; j++) {
        if (a[j] % i == 0) a[j] /= i;
      }
      ans *= i;
    }
  }
  cout << ans << endl;
  return 0;
}
