#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep_S(i,r,n) for(int i = r; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define RSort(a) sort(a.rbegin(), a.rend())
#define Output(a) cout << a << endl
 
typedef long long int ll;

typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<string> vst;

const ll INF = 0x1fffffffffffffff;
const ll MOD = 1000000007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    ll n,cnt=0; cin >> n;
    vll a(n);
    vll b(200);
    rep(i, n) cin >> a[i];

    rep(i,n){
        b[a[i]%200]++;
    }
    rep(i,200){
        cnt = cnt + (b[i] * (b[i] - 1)) / 2;
    }
    cout << cnt << endl;
}
#include<bits/stdc++.h>
using namespace std;

const int MaxN = 2e5;
const int MaxA = 1e9;

signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	
	int N, v;
	while(cin >> N){
		long ans = 0;
		vector<int> cnt(200);
		for(int i = 0; i < N; i++){
			cin >> v;
			v = v % 200;
			ans += cnt[v];
			cnt[v] += 1;
		}
		cout << ans << '\n';
	}
}