#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
const ll mod=998244353;
const int N=2001;
ll n,m;
ll a[N];
vector<pair<ll,int> >pf;
vector<int>ans;
ll duh[100001];
ll mg[100001];
int d[31];
bool inc(int t){
	if(t==0) return true;
	d[pf.size()-1]++;
	int x=pf.size()-1;
	while(x>=0 && d[x]>pf[x].se){
		d[x]=0;
		x--;
		if(x<0) break;
		d[x]++;
	}
	return(x>=0);
}
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	cin >> n;
	//n=2000;
	for(int i=1; i<=n ;i++){
		cin >> a[i];
		//a[i]=2162160;
	}
	sort(a+1,a+n+1);
	if(a[1]==1){
		cout << "1\n";
		return 0;
	}
	int work=0;
	for(int i=1; i<=n ;i++){
		//if(i%100==0) cout << "doing " << i << ' '  << work << endl;
		ll z=a[i];
		pf.clear();
		for(int j=2; j*j<=a[i] ;j++){
			if(z%j!=0) continue;
			pf.push_back({j,0});
			while(z%j==0){
				pf.back().se++;
				z/=j;
				//work++;
			}
		}
		if(z!=1) pf.push_back({z,1});
		int mx=0;
		for(int k=0; inc(k) ;k++){
			duh[k]=0;
			mx=max(mx,k);
		}
		//cout << mx << endl;
		for(int j=1; j<=n ;j++){
			int y=0;
			int cnt=0;
			for(auto c:pf){
				ll z=c.fi;
				y*=(c.se+1);
				for(int p=1; p<=c.se ;p++){
					if(a[j]%z!=0) break;
					z=z*c.fi;y++;
					//work++;
					cnt++;
				}
			}
			//if(j==1) cout << i << ' ' << cnt << endl;
			duh[y]++;
		}/*
		cout << "doing " << i << ' ' << a[i] << endl;
		for(int k=0; inc(k) ;k++){
			cout << duh[k] << ' ' << d[0] << ' ' << d[1] << endl;
			
		}*/
		ll step=1;
		//cout << pf.size() << endl;
		for(int j=pf.size()-1; j>=0 ;j--){
			for(int k=0; inc(k) ;k++){
				work++;
				
				if(d[j]==0){
					if(j==pf.size()-1){
						for(int p=k+step*pf[j].se ;p>=k ;p-=step){
							mg[p]=1;
							//work++;
						}
					}
					for(int p=k+step; p<=k+step*pf[j].se ;p+=step){
						mg[p]=mg[p-step]*pf[j].fi;//work++;
					}
					for(int p=k+step*pf[j].se ;p>k ;p-=step){
						duh[p-step]+=duh[p];
						//work++;
					}
				}
			}
			step*=pf[j].se+1;
		}/*
		cout << endl;
		for(int k=0; inc(k) ;k++){
			cout << duh[k] << ' ' << d[0] << ' ' << d[1] << endl;
			
		}*/
		for(int k=0; inc(k) ;k++){
			ll step=1;
			bool ok=true;
			for(int j=pf.size()-1; j>=0 ;j--){
				work++;
				if(d[j]==pf[j].se){
					step*=pf[j].se+1;continue;
				}
				if(duh[k]==duh[k+step]) ok=false;
				step*=pf[j].se+1;
			}
			if(ok) ans.push_back(mg[k]);
		}
	}
	//cout << ans.size() << endl;
	sort(ans.begin(),ans.end());
	ans.erase(unique(ans.begin(),ans.end()),ans.end());
	while(ans.back()>a[1]) ans.pop_back();
	cout << ans.size() << '\n';
}
#include <iostream>
#include <vector>
#include <limits>
#include <cstring>
#include <time.h>
#include <math.h>
#include <algorithm>
#include <random>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <chrono>
#include <sstream>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
typedef vector<pii > vii;
typedef vector<vector<ll> > vvi;
typedef vector<vvi > vvvi;
typedef vector<vector<pair<ll, ll> > > vvii;
typedef ll func_ii_i(ll, ll);

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,s,e) for(ll i=(s);i<(e);++i)
#define repr(i,s,e) for(ll i=(e);i>(s);--i)
#define io do { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(10); } while (0)
#define endl '\n'
#define newl cout << '\n';

#define fill0(a) memset(a, 0, sizeof(a))
#define fill1(a) memset(a, -1, sizeof(a))

#define all(v) v.begin(), v.end()
#define bg begin()
#define ed end()
#define tr(it, v) for (auto it = v.bg; it != v.ed; it++)
#define prv(v) do { tr(it, v) { cout << *it << " "; }; cout << endl; } while (0)
#define prm(m) tr(it, m) { cout << it->first << " -> " << it->second << endl; }
#define scan(a, n) rep(i,0,n) cin >> a[i];
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define sumv(v) accumulate(all(v), 0ll)
#define ub(a, x) upper_bound(all(a), x)
#define lb(a, x) lower_bound(all(a), x)

#define tcT template<class T

ll min3(ll a, ll b, ll c) { return min(a, min(b, c)); }
ll max3(ll a, ll b, ll c) { return max(a, max(b, c)); }
ll mid3(ll a, ll b, ll c) { return a + b + c - min3(a, b, c) - max3(a, b, c); }
ll ceil1(ll x, ll y) { if(x % y) return (x + y) / y; else return x / y; }
tcT> void rmdup(vector<T> &v) { sort(all(v)); v.erase(unique(all(v)), v.ed); }
tcT> ll fst1(ll l, ll h, T f) {
	++h; // f is increasing
	while(l<h) {
		ll mi = l + ((h - l) >> 1);
		f(mi) ? h = mi : l = mi + 1;
	}
	return l;
}
tcT> ll lst1(ll l, ll h, T f) {
	--l; // f is decreasing
	while(l<h) {
		ll mi = l + ((h - l + 1) >> 1);
		f(mi) ? l = mi : h = mi - 1;
	}
	return l;
}

const ll MOD = 1e9+7;
const ll INF = 1e16;
const ll TE3 = 1005;
const ll TE5 = 300005;
const ll dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
const string YN[2] = {"NO", "YES"};

using namespace std;

void divisors(ll x,vi &u)
{
	if(x==1) {
		return;
	}
	for (ll d = 2; d * d <= x; ++d)
	{
		ll c = 0;
		if(x%d==0) {
			u.pb(d);
			if((d*d)!=x) {
				u.pb(x/d);
			}
		}
	}
}

// computes gcd(a,b)
ll gcd(ll a, ll b) {
	if(a<b)
		swap(a, b);
	while (b)
	{
		ll t = a % b;
		a = b;
		b = t;
	}
	return a;
}

int main()
{
	io;
	ll n;
	cin >> n;
	vi v(n);
	scan(v, n);
	sort(all(v));
	set<ll> ans;
	map<ll,ll> z;
	for (ll q: v) {
		vi u;
		divisors(q, u);
		u.pb(1);
		u.pb(q);
		rmdup(u);
		for(ll d: u) {
			if(z.count(d)) {
				z[d]=gcd(z[d], q);
			} else {
				z[d]=q;
			}
		}
	}
	for(auto it: z) {
		if(it.se && it.se<=v[0]) {
			ans.insert(it.se);
		}
	}
	cout<<ans.size()<<endl;
	// for(ll q: ans) {
	// 	cout<<q<<" ";
	// }
	// cout<<endl;
	return 0;
}

