#include <iostream>
#include <vector>
using namespace std;


int nwd(int a, int b){
	
	while(b!= 0){
		
		int p= a%b;
		a=b;
		b=p;
	}
   return a;
}

int main() {


ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    
 int n;
 cin >>n;
  

 vector<int> ted(n);
 
 for(int i=0;i <n; i++){
 	cin >> ted[i];
 }

  long long wynik =0;
  
  for(int i =0; i <n ;i++){
  	
  	for(int j= i+1; j <n ;j++){
  		
  		if(nwd(ted[i], ted[j])==1){
  			wynik++;
  		}
  	 }
  	
  }

cout << wynik << endl;

	return 0;
}