#include int gcd(int a, int b) { int r = a % b; while (r > 0) { a = b; b = r; r = a % b; } return b; } int main() { int n; scanf("%d", &n); int a[102]; int i, j, k; for (i = 0; i < n; i++) scanf("%d", &a[i]); int ans = 0; for (i = 0; i < n; i++) for (j = i + 1; j < n; j++) for (k = j + 1; k < n; k++) if (gcd(a[i], gcd(a[j], a[k])) == 1) ans++; printf("%d\n", ans); return 0; }