#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; constexpr int INF = 2e9; int main() { int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; int res = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1; k < n; k++) { int g = __gcd(a[i], a[j]); g = __gcd(g, a[k]); if (g == 1) res++; } } } cout << res << endl; return 0; }