#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[1000000];
int ucln(int a,int b)
{
    int r;
    while(b)
        r = a % b, a = b, b = r;
    return (a == 1);
    if(b == 0)
        return (a == 1);
    return ucln(b,a%b);
}
int main()
{
    ifstream f1("NTCN.inp");
    ofstream f2("NTCN.out");
    long long dem=0;
	f1>>n;
	for (long long i=0;i<n;i++)
    {
        f1>>a[i];
    }
    for (long long i=0;i<n-1;i++)
    {
        for (long long j=i+1;j<n;j++)
        {
            if (ucln(a[i],a[j])==1)
            {
                dem++;
            }
        }
    }
f2<<dem;
f1.close();
f2.close();
}


