#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,n,dem=0,x;
		cin>> n;
		d=n;
		int freq[300000];
		int a[n+1];
		for (int i=0; i<n; i++)
			cin>>a[i];
	
	for ( x=0; x<d; x++)
		for ( c=x; c<d; c++)
			if (a[x]>1&&a[c]>1&&ucln(a[x],a[c])==1) dem++;
	cout << dem;
}
