#include <bits/stdc++.h>
using namespace std;
const int N = 105, mod = 1000000;
int n, m, a[N];
void read (int &x) {
    char ch = getchar(); x = 0; while (!isdigit(ch)) ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
}
struct ll {
    int p[550], len;
    ll() { memset (p, 0, sizeof (p)); len = 0; }
    void print() {
        printf ("%d", p[len]);
        for (int i = len - 1; i > 0; --i) {
            if (!p[i]) { printf ("0000"); continue; }
            for (int k = 10; k * p[i] < mod; k *= 10)
                putchar (48);
            printf ("%d", p[i]);
        } putchar ('\n');
    }
    // ll operator + (const ll &a) const {
    //     ll t; t.len = max (len, a.len); int q = 0;
    //     for (int i = 1; i <= t.len; ++i) {
    //         t.p[i] = p[i] + a.p[i] + q;
    //         q = t.p[i] / mod; t.p[i] %= mod;
    //     }
    //     if (q > 0) t.p[++t.len] = q; return t;
    // }
    // ll operator + (const int &a) const {
    //     ll t; t.len = max (len, 10); int q = 0;
    //     for (int i = 1; i <= t.len; ++i) {
    //         t.p[i] = p[i] + a % mod + q;
    //         q = t.p[i] / mod; t.p[i] %= mod, a /= mod;
    //     }
    //     if (q > 0) t.p[++t.len] = q; return t;
    // }
    ll operator * (const int &a) const {
        ll t; t.len = len; int q = 0;
        for (int i = 1; i <= len; ++i) {
            t.p[i] = p[i] * a + q;
            q = t.p[i] / mod, t.p[i] %= mod;
        }
        while (q) t.p[++t.len] = q % mod, q /= mod;
        return t;
    }
} res; int lim = 10000, tot, cnt[100000], tp, t[100000];
int is (int x) {
    if (x == 1) return 0;
    for (int i = 2; i * i <= x; ++i)
        if (x % i == 0) return 0; return 1;
}
signed main() {
    read (n); res.len = 1, res.p[1] = 1;
    for (int i = 1; i <= n; ++i) read (a[i]);
    for (int i = 1; i <= n; ++i)
        if (is (a[i])) t[++tp] = a[i], res = res * a[i];
    for (int i = 1; i <= n; ++i) {
        if (is (a[i])) continue;
        int tag = 0;
        for (int j = 1; j <= tp; ++j)
            if (a[i] % t[j] == 0) {  tag = 1; break; }
        if (tag) continue; ++tot;
        for (int j = 1; j <= lim; ++j)
            if (__gcd (j, a[i]) != 1) ++cnt[j];
    }
    for (int i = 1; i <= lim; ++i)
        if (cnt[i] == tot) { res = res * i; break; }
    return res.print(), 0;
}

#include<bits/stdc++.h>
using namespace std;
// typedef long long long long int ll;
int main()
{

long long int n;
cin>>n;
long long int arr[n];
for (long long int i = 0; i < n; ++i)
{
    cin>>arr[i];
}
if (n==1)
{
    cout<<arr[0]<<"\n";
    return 0;
}

for (int i = 0; i < n; ++i)
{
    for (int j = 0; j < n; ++j)
    {
            if (__gcd(arr[i],arr[j])!=1)
            {
                arr[i]=arr[j]=__gcd(arr[i],arr[j]);
            }
    }
}
set <int>s(arr,arr+n);
std::vector<int> v2(s.begin(), s.end());
std::vector<int> v3;
for (int i = 0; i < v2.size(); ++i)
{
    for (int j = 2; j <= 50; ++j)
    {
            if (v2[i]%j==0)
            {
                v3.push_back(j);
                break;
            }
    }
}
long long int h=1;
for (int i = 0; i < v3.size(); ++i)
{
        h*=v3[i];
}
cout<<h<<"\n";
return 0;
}