#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
using namespace std;
int n,mi,ans;
map<int,int> md;
int gcd(int x,int y){return y==0?x:gcd(y,x%y);}
int main()
{
	int a;
	scanf("%d",&n);
	mi=1<<30;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a);
		mi=min(mi,a);
		for(int j=1;j*j<=a;j++)
			if(a%j==0)md[j]=gcd(md[j],a),md[a/j]=gcd(md[a/j],a);
	}
	for(map<int,int>::iterator i=md.begin();i!=md.end();i++)
		if(i->first==i->second&&i->first<=mi)ans++;
	printf("%d",ans);
	return 0;
}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a[i];
	int ans = 0;
	int kazu = 0;
	for(int j = 2; j <=1000; j++){
		int counts = 0;
		rep(i,n){
			if(a[i]%j == 0) counts++;
		}
		if(ans < counts) {
			kazu = j;
			ans = counts;
		}
	}
	cout << kazu << endl;
	return 0;
}

// cout << fixed << setprecision(15) <<  << endl;
