#include <iostream>
using namespace std;
int main()
{
  const long long int a = 1e6;
  int number[&a];
  int n;
  cin >> n;

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

  for(int i=0; i<n; i++){
    for(int t=i; t<n; t++){
        if(number[i]>number[t])
            swap(number[i], number[t]);
    }
  }
  int answer = 0;
  for(int i=0; i < n; i++){
    for(int t = i+1; t<n; t++){
        for(int j = t+i; j<n; j++){
            if(number[i] < number[t] && number[t] < number[j] && number[t]%number[i]==0 && number[j]%number[t]==0){
                answer++;
            }
        }
    }
  }
  cout << answer;
    return 0;
}
