#include "bits/stdc++.h"
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A.at(i);
	}
	sort(A.begin(), A.end());

	int max = 0,maxk = 2;
	for (int k = 2; k <= A.at(N - 1); k++) {
		int cnt = 0;
		for (int i = 0; i < N; i++) {
			if (A.at(i) % k == 0) cnt++;
		}
		if (cnt >= max) {
			max = cnt;
			maxk = k;
		}
	}
	cout << maxk << "\n";
}
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>










ll n, sm, res, a;
map<ll, ll>m;




void solve()
{
	cin >> n;
	sm = 0;
	res = 0;
	m.clear();
	m[0] = 1;
	for(int i = 1; i <= n; i++)
	{
		cin >> a;
		if(i & 1)sm += a;
		else sm -= a;
		res += m[sm];
		m[sm]++;
	}
	cout << res << "\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt", "r", stdin);
#endif
	solve();
	return 0;
}