#include using namespace std; using ll = long long; using Graph = vector>; long long GCD(long long a,long long b) { if(a%b == 0) return b; return GCD(b,a%b); } int main() { int N; cin >> N; vector A(N); int ans = 0; for(int i = 0; i < N; i++)cin >> A[i]; for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { for(int l = j + 1; l < N; l++){ long long x = GCD(A[i],A[j]); long long y = GCD(x,A[l]); if(y == 1) { ans++; } } } } cout << ans << endl; }