#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

// size(x), rbegin(x), rend(x) need C++17
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define rall(x) x.rbegin(), x.rend() 
#define sor(x) sort(all(x)) 
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second


#define mset(a,b) memset(a, b, sizeof(a))
#define dbg(x) cout << "[" << #x << "]: " << x << endl;
#define forn(i,n) for(int i=0; i < n;i++)
#define nrof(i,n) for(int i = n-1; i >= 0; i--)
#define fori(i,a,b) for(int i = a; i <= b; i++)
#define irof(i,b,a) for(int i = b; i >= a; i--)
#define each(val, v) for(auto &val : v)

using ll = long long;
using db = long double; //pode ser double

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;

using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<db>; 
using vs = vector<string>;
using vpi = vector<pi>;
using vpl = vector<pl>; 
using vpd = vector<pd>;


const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const db EPS = 1e-9;
const db PI = acos((db)-1);

void solve(){
    int n;
    cin >> n;
    n -= 1;
    cout << n << '\n';
}

int main(){

    ios::sync_with_stdio(false); cin.tie(NULL);

    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }

    return 0;
}

/*
PRESTA ATENCAO!!!!

NAO FIQUE PRESO EM UMA ABORDAGEM
A SUA INTUICAO PODE ESTAR ERRADA - TENTE OUTRAS COISAS
LIMPOU TUDO PARA O PROXIMO CASO?
caso especial? n == 1 

*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
    ll n;
    cin>>n;
    ll a[n];
    ll max=0,res=-1;
    for(ll i=0;i<n;i++)     cin>>a[i];
    for(ll i=2;i<1000;i++)
    {
        ll cnt=0;
        for(ll j=0;j<n;j++){
            if(a[j]%i==0)       cnt++;
        }
        if(cnt>max)     max=cnt,res=i;
    }
    cout<<res;
    return 0;
}