#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());
    boost::rational<boost::multiprecision::cpp_int> r(0);
    for(int_fast64_t i = 0 ; i < N; ++i)r = (r * a[i] + i) / a[i];
    if(boost::rational_cast<boost::multiprecision::cpp_int>(r) != r){
        printf("%lld", a[0]);
    }else{
        assert(1 != 1);
    }
    return 0;
}
