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

template<typename T>
vector<pair<T, int>> prime_factor(T num) {
  vector<pair<T, int>> ret;
  for(T i=2; i*i<=num; ++i) {
    int cnt = 0;
    while(num%i == 0) {
      num /= i;
      ++cnt;
    }
    if(cnt != 0) ret.emplace_back(i, cnt);
  }
  if(num != 1) ret.emplace_back(num, 1);
  return ret;
}

// if (srt > 0), sorted by ascending order. else if (srt < 0), sorted by descending order.
template<typename T>
vector<T> divisor(vector<pair<T, int>> &pf, int srt) {
  vector<T> ret;
  ret.emplace_back(1);
  for(auto &p : pf) {
    int sz = ret.size();
    T x; int y;
    tie(x,y) = p;
    T d = 1;
    for(int i=0; i<y; ++i) {
      d *= x;
      for(int j=0; j<sz; ++j) {
        ret.emplace_back(d * ret[j]);
      }
    }
  }
  if(srt > 0) sort(ret.begin(), ret.end());
  else if(srt < 0) sort(ret.rbegin(), ret.rend());
  return ret;
}

template<typename T>
vector<T> divisor(const T &num, int srt) {
  auto pf = prime_factor(num);
  return divisor(pf, srt);
}

void solve() {
  int n; cin >> n;
  vector<int> a(n);
  for(auto &x : a) cin >> x;

  unordered_map<int, int> cnt;
  map<int, vector<int>, greater<int>> to;
  to[1] = {};

  for(auto &x : a) {
    auto pf = prime_factor(x);
    auto div = divisor(pf, 0);
    for(auto &d : div) {
      ++cnt[d];
      if(!to.count(d)) {
        for(auto &[p, c] : pf) {
          if(d % p == 0) {
            to[d].emplace_back(d / p);
          }
        }
      }
    }
  }

  unordered_set<int> ng;
  int ans = 1;
  int MIN = *min_element(begin(a), end(a));

  for(auto &[d, vec] : to) {
    if(d < MIN && !ng.count(d)) ++ans;
    for(auto &x : vec) {
      if(cnt[x] < 2 || cnt[x] == cnt[d]) {
        ng.emplace(x);
      }
    }
  }

  cout << ans << endl;
}

signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  solve();
  return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define N 2005
#define mod 998244353
#define LL long long

int n, a_min, i, a[N], j, ans;
vector<int> vec;
unordered_set<int> Ans;
map<int,int> A, ext;

int main (void)
{
	scanf("%d",&n);
	a_min=-1;
	for (i=1; i<=n; i++) {
		scanf("%d",&a[i]);
		if (a_min==-1) a_min=a[i];
		else a_min=min(a_min,a[i]);
		vec.clear();
		for (j=1; j*j<=a[i]; j++)
			if (a[i]%j==0) {
				vec.push_back(j);
				if (j*j!=a[i]) vec.push_back(a[i]/j);
			}
		sort(vec.begin(),vec.end());
		ext.clear();
		for (j=vec.size()-1; j>=0; j--) {
			if (ext.count(A[vec[j]])) continue;
			ext[A[vec[j]]]=1;
			Ans.insert(vec[j]);
		}
		for (j=0; j<vec.size(); j++) A[vec[j]]=((LL)A[vec[j]]*n+i)%mod; 
	}
	ans=0;
	for (auto x:Ans) if (x<=a_min) ans++;
	printf("%d\n",ans);
	return 0;
}