#include using namespace std; #define rep(i,a,b) for(LL i = a;ib; i--) #define tobirep(i,a,b,c) for(LL i = a;ib; i-=c) #define INF ((1LL<<62)-(1LL<<31)) #define ooki 9223372036854775807 #define tii -9223372036854775808 typedef long long LL; int main(){ LL n,count=0; cin >> n; vector a(n); rep(i,0,n){cin >> a[i];} rep(i,0,n){ rep(j,i+1,n){ rep(k,j+1,n){ if(gcd(gcd(a[i],a[j]),a[k])==1){count++;} } } } cout << count << '\n'; }