#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
#include<boost/rational.hpp>
using namespace std;

int main(){
    int_fast64_t N;
    scanf("%ld", &N);
    vector<int_fast64_t> a(N);
    for(int_fast64_t i = 0; i < N; ++i)scanf("%ld", &a[i]);
    sort(a.begin(), a.end());
    int_fast64_t j(a[1]), k(1);
    for(int_fast64_t i = 2; i < N; ++i)j = __gcd(j, a[i]);
    for(int_fast64_t i = 2, l; i < N; ++i){
        l = __gcd(i, j);
        k *= l;
        j /= l;
    }
    printf("%ld\n", a[0] * k);
    return 0;
}
