#include <fstream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;
ucln(int a, int b)
{
    while (b > 0)
    {
        int r = a%b;
        a = b;
        b = r;
    }
    return a;
}
int main()
{
    ios::sync_with_stdio(false);
    ifstream fi("ntcn.inp");
    ofstream fo("ntcn.out");
    int n,d = 0;
    fi >> n;
    vector <int> a(n);
    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) d++;
    }
    fo << d;
    return 0;
}

