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