#include<bits/stdc++.h>
#define N 5000005
using namespace std;
int read() {
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
int n,a[N],b[N],ans;
bool tag[2005];
int main() {
	n = read();
	for(int i=1; i<=n; ++i)a[i] = read();
	for(int i=1; i<=n; ++i) {
		for(int j=1; j<=sqrt(a[i]); ++j) {
			if(a[i]%j == 0)b[++b[0]] = j,b[++b[0]] = a[i]/j;
		}
	}
	sort(b+1,b+b[0]+1);
	b[0] = unique(b+1,b+b[0]+1)-b-1;
	for(int i=1; i<=b[0]; ++i) {
		int x = b[i],now = 0,id,suc;
		memset(tag,0,sizeof(tag));
		for(int j=1; j<=n; ++j)if(a[j]%x == 0){suc = now = a[j];id = j+1;tag[j] = 1;break;}
		for(int j=id; j<=n; ++j) {
			if(a[j]%x == 0)now = __gcd(now,a[j]),tag[j] = 1;
		}
		if(now == x)suc = 1;
		else suc = 0;
		for(int j=1; j<=n; ++j)if(now > a[j])suc = 0;
		ans += suc;
	}
	cout << ans;
}
#include <algorithm>
#include <iostream>
#include <unordered_map>
#include <vector>

using namespace std;
int main() {
  int n;
  cin >> n;

  vector<int> a(n);
  for (int i = 0; i < n; ++i)
    cin >> a[i];
  int lo = *min_element(a.begin(), a.end());

  unordered_map<int, int> memo;
  for (int ai : a) {
    for (int j = 1; j * j <= ai && j < lo; ++j) {
      if (ai % j == 0) {
        memo[j] = __gcd(ai, memo[j]);
        if (ai / j < lo)
          memo[ai / j] = __gcd(ai, memo[ai / j]);
      }
    }
  }

  int ans = 1;
  for (auto [factor, terminal] : memo)
    if (factor == terminal)
      ans++;

  cout << ans;
}
