#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define pb push_back
#define f(i,n) for(int i=0; i<n; ++i)
#define fi(i,st,n) for(int i=st; i<=n; ++i)
#define veci vector<int>
#define vecp vector<pair<int,int> >
#define vecl vector<ll>
int prime[100000+10];

ll lcm(ll a, ll b) {
	return a*b/__gcd(a,b);
}

ll power(ll a, ll n, ll mod) {
	ll res = 1;
	while(n > 0) {
		if(n&1) {
			res = (res*a)%mod;
		}
		a = (a*a)%mod;
		n = n/2;
	}
	return res;
}

ll sum(int arr[], int n) {
	ll res = 0;
	f(i,n) {
		res += arr[i];
	}
	return res;
}

void seive() {
	prime[1] = 0;
	for(int i=2; i<=100000; i++) {
		prime[i] = 1;
	}
	for(ll i=2; i<=100000; i++) {
		if(prime[i]) {
			for(ll j=i*i; j<=100000; j+=i) {
				prime[j] = 0;
			}
		}
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1;
//	cin>>t;
	while(t--){
		ll n;
		cin>>n;
		ll arr[n];
		f(i,n) cin>>arr[i];
		ll count[200] = {0};
		f(i,n) {
			count[arr[i]%200]++;
		}
		ll ans = 0;
		for(int i=0; i<200; i++) {
			ans += count[i]*(count[i]-1)/2;
		}
		cout<<ans<<"\n";
	}
 	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>

int main(){
    long long n, ans = 0;
    std::cin >> n;
    std::vector <int> a(n);
    std::vector <std::vector<int> > list(200, std::vector<int>(0));
    
    for (int i = 0; i < n; ++i){
        std::cin >> a[i];
    }

    for (int i = 0; i < n; ++i){
        int k;
        k = a[i] % 200;
        list[k].push_back(a[i]);
    }

    // std::sort(a.begin(), a.end());

    // for (int i = 0; i < n; ++i){
    //     for (int j = i+1; j < n; ++j){
    //         if ((a[j] - a[i]) % 200 == 0) ans++;
    //     }
    // }

    for (int i = 0; i < 200; ++i){
        long long k = list[i].size();
        if (k > 1){
            ans += ((k * (k - 1)) / 2);
        }
    }
    
    std::cout <<  ans  << std::endl;

    return 0;
}
