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

const int N=2000+5;

inline int read()
{
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
	    if(c=='-')
	        f=-1;
	    c=getchar();
	}
	while(c>='0'&&c<='9')
	{
	    x=x*10+c-'0';
	    c=getchar();
	}
	return x*f;
}

int n;
int a[N];

inline int exgcd(int x,int y)
{
	if(!y) return x;
	return exgcd(y,x%y);
}

map<int,int> re;
map<int,int>::iterator it;

int main()
{
	n=read();
	int minn=0x3f3f3f3f;
	for(int i=1;i<=n;i++) a[i]=read(), minn=min(minn,a[i]);
	for(int i=1;i<=n;i++)
	{
		int t=sqrt(a[i]);
		for(int j=1;j<=t;j++)
		{
			if(a[i]%j!=0) continue;
			if(j<=minn) re[j]=exgcd(re[j],a[i]);
			if(a[i]/j<=minn) re[a[i]/j]=exgcd(re[a[i]/j],a[i]);
		}
	}
	int ans=0;
	for(it=re.begin();it!=re.end();it++)
		if((*it).first==(*it).second) 
			ans++;	
	printf("%d\n",ans);
	return 0;
}
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
#define int LL
typedef pair<int, int> PII;
typedef pair<int, LL> PIL;
const int N = 5e5 + 10, M = 3e5 + 10;
const int inf = 0x3f3f3f3f;
const LL INF = 0x3f3f3f3f3f3f3f3f;
#define x first
#define y second
const int mod = 1e9 + 7;
#define gcd __gcd

map<int, int> cnt;
int a[N];
int b[N];

void solve() {
	int n;
	scanf("%lld", &n);
	cnt[0] = 1;
	LL res = 0, sum = 0;
	for(int i = 1; i <= n; i++) {
		int x;
		scanf("%lld", &x);
		if(i & 1) x = -x;
		sum += x;
		if(cnt.count(sum)) res += cnt[sum];
		cnt[sum]++;
	}
	printf("%lld\n", res);
}

signed main() {
	// freopen("in.txt", "r", stdin);
    // int t; cin >> t; while(t--)
    solve();
    return 0;
}
