#include using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair P; ll gcd(ll x, ll y) { if (y > x) swap(y, x); if (y == 0) return x; return gcd(y, x % y); } int main() { int n; cin >> n; vector a(n); REP(i, n) cin >> a[i]; ll ans = 0; REP(i, n - 2) for (int j = i + 1; j < n - 1; j++) for (int k = j + 1; k < n; k++) { ll Z = gcd(gcd(a[i], a[j]), a[k]); if (Z == 1) ans++; } cout << ans << endl; }