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