/*                                                       
  /^--^\                                                 
  \____/                                                 
 /      \ _____  _ __  __ ____  _     ____   ____  _____ 
|        || ()_)| |\ \/ /| ===|| |__ / (__` / () \|_   _|
 \__  __/ |_|   |_|/_/\_\|____||____|\____)/__/\__\ |_|  
|^|^\ \^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|
| | |\ \| | | | | | | | | | | | | | | | | | | | | | | | |
#####/ /#################################################
| | |\/ | | | | | | | | | | | | | | | | | | | | | | | | |
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|*/
#pragma GCC optimize("O4,unroll-loops,no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<ll,ll>;
#define int ll
#define double long double

#define For(i,a,b)  for(int i=a;i<=b;i++)
#define Forr(i,a,b) for(int i=a;i>=b;i--)
#define F first
#define S second
#define L(id) (id<<1)
#define R(id) (id<<1|1)

#define eb emplace_back
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define mkp make_pair

#define MOD (ll)(1e9+7)
#define INF (1e15)
#define EPS (1e-6)

#ifdef LOCALMEOW
#define debug(...) do{\
	cerr << __PRETTY_FUNCTION__ << " - " << __LINE__ <<\
	" : ("#__VA_ARGS__ << ") = ";\
	_OUT(__VA_ARGS__);\
}while(0)
template<typename T> void _OUT(T x) { cerr << x << "\n"; }
template<typename T,typename...I>
void _OUT(T x,I ...tail) { cerr << x << ", "; _OUT(tail...); }
#else
#define debug(...)
#endif
inline void IOS(){ ios::sync_with_stdio(false); cin.tie(0); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
int fpow(int b,int p){
	int ans=1,now=b;
	while(p){
		if(p&1) ans=ans*now%MOD;
		p/=2; now=now*now%MOD;
	}
	return ans;
}
void minify(int &a,int b) { if(b<a) a=b; }
void maxify(int &a,int b) { if(b>a) a=b; }

int32_t main(){
	IOS();
	//code...
	int n; cin>>n;
	unordered_map<int,int> mp;
	int t;
	int mn=INF;
	while(n--){
		cin>>t;
		mn=min(mn,t);
		for(int i=1;i*i<=t;i++) if(t%i==0){
			if(mp.count(i)) mp[i]=__gcd(mp[i],t);
			else mp[i]=t;
			if(mp.count(t/i)) mp[t/i]=__gcd(mp[t/i],t);
			else mp[t/i]=t;
		}
	}
	int ans=0;
	for(auto &i:mp)
		if(i.F<=mn && i.F==i.S) ans++;
	cout<<ans<<"\n";
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define x1 gdsfdsf
#define y1 fgdfgdfg
#define endl '\n'
const ll DIM = 2000+7;
ll A[DIM],G[DIM];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n;
    cin>>n;
    for(ll i = 1;i<=n;++i)cin>>A[i];
    sort(A+1,A+1+n);
    G[0] = A[1];
    for(ll i = 1;i<=n;++i){
        G[i] = __gcd(G[i-1],A[i]);
    }
    map<ll,ll> M;
    for(ll i = 1;i<=n;++i){
        ll sq = sqrt(A[i]);
        for(ll div = 1;div<=sq;++div){
            if (A[i]%div!=0)continue;
            ll prev = div;
            div = A[i]/div;
            {
                if (M.count(div)==0)M[div] = A[i];
                else M[div] = __gcd(M[div],A[i]);
            }
            div = prev;
            {
                if (M.count(div)==0)M[div] = A[i];
                else M[div] = __gcd(M[div],A[i]);
            }
        }
    }
    ll ptr = 0;
    G[0] = 0;
    ll res = 0;
    for(auto to:M){
        if (to.first!=to.second)continue;
        while(A[ptr+1]<=to.first && ptr<n)++ptr;
        if (G[ptr]%to.first==0)++res;
    }
    cout<<res<<endl;
    return 0;
}
