#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    vector<int> a(200,0);
    for(int i = 0; i < n; i++){
        int tmp;
        cin >> tmp;
        a[tmp%200] += 1;
    }
    ll ans = 0;
    for(int i = 0; i < 200; i++){
        ans += ((ll)a[i]*a[i]-a[i])/2;
    }
    cout << ans << endl;
}

#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define pie  3.14159265
#define ll long long int
#define fr(i,a,n) for(ll i=a;i<n;i++)
#define vi vector<int>
#define vlli vector<ll>
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fv(i,a) for(auto i:a)
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()
#define frv(i,c) for(auto i = c.begin(); i != c.end(); i++)

void solve()
{
	vlli vis(200, 0);
	ll n;
	cin >> n;
	fr(i, 0, n)
	{
		ll x;
		cin >> x;
		vis[x % 200]++;
	}
	ll ans = 0;
	fr(i, 0, 200)
	{
		ans += max((vis[i] * 1LL * (vis[i] - 1)) / 2, 0LL);
	}
	cout << ans << endl;
}


int main() {
//#ifndef ONLINE_JUDGE
#ifdef yogi23
	freopen("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}


	return 0;
}