#include<bits/stdc++.h>
using namespace std;

#define ll long long

int main(){
    ll n;
    cin>>n;
    ll arr[n];
    ll m[201];
    memset(m,0,sizeof(m));
    
    for(ll i=0; i<n; i++){
        cin>>arr[i];
        m[arr[i]%200]++;
    }
    ll sum=0;
    
    for(int i=0; i<= 200; i++){
        sum += m[i]*(m[i]-1);
    }
    
    cout<<sum/2;
    return 0;   
}
#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 1000000007;
using ll = long long;
vector<int> dx = {0,1,0,-1};
vector<int> dy = {-1,0,1,0};

long long pow(long long x,long long n){
    long long ans = 1;
    while(n != 0){
        long long a = x;
        long long z = 1;
        while(z*2 <= n){
            a *=a;
            a=a%mod1;
            z*=2;
        }
        ans*=a;
        ans=ans%mod1;
        n-=z;
    }
    return ans; 
}//累乗 x^n

template<typename T>
void input_vec(vector<T> &A,long long N){
    for(int i = 0; i < N; i++){
        cin >> A.at(i);
    }
    return;
}//入力を配列で受け取る

template<typename T>
void output_vec(vector<T> &A,long long N){
    for(int i = 0; i < N; i++){
        if(i != 0){
            cout << " ";
        }
        cout << A.at(i);
    }
    cout << endl;
    return;
}//配列を出力

template<typename T>
long long count_vec(vector<T> &A,T x){
    long long counter = 0;
    for(int i = 0; i < (int)A.size(); i++){
        if(A.at(i) == x){
            counter++;
        }
    }
    return counter;
}//配列内のxの個数をreturn


vector<char> change_vec(string s,int n){
    vector<char> ans(n);
    for(int i = 0; i < n; i++){
        ans.at(i) = s.at(i);
    }
    return ans;
}//文字列を配列に変換

int main(){
    ll N;cin >> N;
    vector<ll> a(N);
    for(int i = 0; i < N; i++){
        cin >> a.at(i);
    }
    for(int i = 0; i < N; i++){
        a.at(i) = a.at(i)%200;
    }
    sort(a.begin(),a.end());
    ll count = 1;
    ll lastnumber = a.at(0);
    ll ans = 0;
    for(int i = 0; i < N-1; i++){
        if(a.at(i+1) == lastnumber){
            count++;
        }
        else{
            ans += count*(count-1)/2;
            count = 1;
            lastnumber = a.at(i+1);
        }
    }
    ans += count*(count-1)/2;
    
    cout << ans << endl;
}
