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

