#include <fstream>
using namespace std;
ifstream f1("ntcn.inp");
ofstream f2("ntcn.out");
long i;
long long a[100000],dem = 0;
int kt(long long a,long long b)
{
    while (a != b)
    {
        if (a > b) a = a - b;
        else b = b - a;
    }
    return a;
}
int main()
{
    f1 >> i;
    for (long n = 0; n < i; n++) f1 >> a[n];
    for (long n = 0; n < i; n++)
    {
        for (long m = i-1; m > n; m--) if(kt(a[n],a[m]) == 1) dem++;
    }
    f2 << dem;
    return 0;
}
