#include <bits/stdc++.h>
using namespace std;
int ucln(int a, int b){
    if (a == 0 || b == 0){
        return a + b;
    }
   
    while (a*b != 0){ 
        if (a > b){
            a %= b; 
        }else{
            b %= a;
        }
    }
    return a + b; 
}
int main ()
{
		freopen ("NTCN.inp", "r", stdin);
		freopen ("NTCN.out", "w", stdout);
		int b[100000],c,d=0,n,dem=0,x;
		cin>> n;
		int freq[300000];
		int a[n+1];
		for (int i=1; i<=n; i++)
			cin>>a[i];
		for (int y=1; y<=n; y++)
		{
			if (freq[a[y]]==0) 
			{
				freq[a[y]]++;
				b[d++]=a[y];
			}
	}
	for ( x=1; x<=d; x++)
		for ( c=x; c<=d; c++)
			if (ucln(b[x],b[c])==1) dem++;
	cout << dem++;
}
