#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
template <typename T>
void pr(T x) {
  cout << x << '\n';
}
long long countarr[200001][21];
void primeFactorsFill(long long n) {
  long long cc = 0;
  while (n % 2 == 0) {
    cc++;
    countarr[2][cc]++;
    n = n / 2;
  }
  for (long long i = 3; i <= sqrt(n); i = i + 2) {
    cc = 0;
    while (n % i == 0) {
      cc++;
      countarr[i][cc]++;
      n = n / i;
    }
  }
  if (n > 2) countarr[n][1]++;
}
void primeFactors(long long n) {
  while (n % 2 == 0) {
    cout << 2 << " ";
    n = n / 2;
  }
  for (long long i = 3; i <= sqrt(n); i = i + 2) {
    while (n % i == 0) {
      cout << i << " ";
      n = n / i;
    }
  }
  if (n > 2) cout << n << " ";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < 200001; i++) {
    for (long long j = 0; j < 21; j++) {
      countarr[i][j] = 0;
    }
  }
  for (long long i = 0; i < n; i++) {
    primeFactorsFill(a[i]);
  }
  long long ans = 1;
  for (long long i = 0; i < 200001; i++) {
    for (long long j = 0; j < 21; j++) {
      if (countarr[i][j] == n) {
        ans *= i;
      } else if (countarr[i][j] == n - 1) {
        ans *= i;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
