#include using namespace std; int main() { int n; cin >> n; vector a( n ); for( int i = 0; i < n; i++ ) { cin >> a[i]; } int ans = 0; for( int i = 0; i < n - 2; i++ ) { for( int j = i + 1; j < n - 1; j++ ) { for( int k = j + 1; k < n; k++ ) { long long gcd = __gcd( a[i], a[j] ); gcd = __gcd( gcd, a[k] ); if( gcd == 1 ) ans++; } } } cout << ans << endl; }