#include using namespace std; long long gcd(long long a, long long b) { if (b == 0) return a; else return gcd(b, a % b); } int main() { long long n; cin >> n; vector v(n); for(long long i = 0; i < n; ++i) cin >> v[i]; long long cnt = 0; for(long long i = 0; i < n; ++i) { for(long long j = i+1; j < n; ++j) { for(long long k = j+1; k < n; ++k) { if(gcd(gcd(v[i],v[j]),v[k]) == 1) ++cnt; } } } cout << cnt << endl; }