#include <bits/stdc++.h>
using namespace std;
bool p[200002];
void seive(long long int n) {
  memset(p, 1, sizeof(p));
  for (long long int i = 2; i * i <= n; i++) {
    if (p[i]) {
      for (long long int j = i * i; j <= n; j += i) {
        p[j] = 0;
      }
    }
  }
}
long long int mxpow(long long int n, long long int p) {
  long long int cnt = 0;
  while (n > 1) {
    if (n % p) {
      break;
    }
    n /= p;
    cnt++;
  }
  return cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  long long int mx = *max_element(v.begin(), v.end());
  long long int s = (long long)(sqrt(mx));
  seive(200002);
  long long int ans = 1;
  for (long long int i = 2; i < 200002; i++) {
    if (p[i]) {
      vector<long long int> k;
      long long int f = 0;
      for (long long int j = 0; j < n; j++) {
        if (v[j] % i) {
          f++;
          if (f == 2) break;
        }
        k.push_back(mxpow(v[j], i));
      }
      if (f == 2) continue;
      sort(k.begin(), k.end());
      ans *= pow(i, k[1]);
    }
  }
  cout << ans << endl;
}
