#include<bits/stdc++.h>
using namespace std;
using Long = long long;
using Double = long double;
using pii = pair<int,int>;
using pll = pair<Long,Long>;
using vi = vector<int>;
using vl = vector<Long>;
using vs = vector<string>;
using vii = vector<pii>;
using vll = vector<pll>;

#define ff first
#define ss second
#define pb push_back
#define pf push_front

#define fore( i, from, to ) for( int i = from; i < to; ++i )
#define forn( i, n ) fore(i, 0, n )
#define fori( i, from, to ) for( int i = to - 1; i >= from; --i )
#define forin( i, n ) fori(i, 0, n )
#define forit( it, cnt ) for( auto &it : cnt )

#define endl '\n'
#define db(x) cout << "[ " << #x << " = " << x << " ]" << endl
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int) v.size()

#define PI acos(-1.0)
#define INF 2e9
#define MOD 1e9 + 7
#define EPS 1e-6

#define fast ios::sync_with_stdio(false); cin.tie(nullptr)

int main(){
    fast;
    int n;
    cin >> n;
    vector<int> v(n);
    forn(i, n) cin >> v[i];
    int mx = 0;
    int ans = 1;
    fore( i, 2, 1001 ){
        int cnt = 0;
        forn( j, n){
            if( v[j] % i == 0 ) cnt++;
        }
        if( mx < cnt ){
            ans = i;
            mx = cnt;
        }
    }
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    vector<int> A(100);
    cin >> N;
    for (size_t i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    int maxcount = 0, count, ans;
    for (size_t i = 2; i <= 1000; i++)
    {
        count = 0;
        for (size_t j = 0; j < N; j++)
        {
            if (A[j] % i == 0)
            {
                count++;
            }
        }
        if (count >= maxcount)
        {
            maxcount = count;
            ans = i;
        }
    }
    cout << ans << endl;
    
    

    return 0;
}
