#include <iostream>
#include <algorithm>
#define ll long long
#define endl "\n"
using namespace std;

const ll maxn=1e6;
ll n,a[maxn],ans=0,i,j,k;

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
    cin >> n;
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a,a+n);
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            for(k=j+1;k<n;k++){
                if(a[k]%a[j]==0 and a[j]%a[i]==0){
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
return 0;
}

