#include <bits/stdc++.h>
using namespace std;
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int i,j;
	while (cin>>i){
		int arr[200]={0};
		long ans = 0;
		for (int a=0;a<i;a++){
			cin>>j;
			ans+=arr[j%200];
			arr[j%200]+=1;
		}
		cout<<ans<<'\n';
	}
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <climits>
#include <map>
#include <set>
#include <iomanip>
#include <unordered_set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <unordered_map>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std;

#ifndef ONLINE_JUDGE
#define imie(x) cerr << #x << " = " << x << '\n';
#else
#define imie(x)
#endif

void debug(vector<int> v) {
	cerr << "[";
	int n = (int)v.size();
	for(int i = 0; i < n; i++) {
		cerr << v[i] << (i == n-1 ? "" : ", ");
	}
	cerr << "]" << '\n';
}

// const int INF = 1e5 + 5;

void test_case() {
	int n;
	cin >> n;
	vector<int> a(n);
	map<int, long long> freq;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		freq[a[i] % 200]++;
	}
	long long cnt = 0;
	for(auto x : freq) {
		cnt += (long long)x.second * (x.second-1);
	}
	cout << cnt / 2LL << '\n';


}
/*
1. Multiset?
2. binary or two pointers
3. edgecases (can it be 0 or 1)
3. Upper_bound or Lower_bound???

Easy Problem = Easy Solution
*/

int32_t main() {
#ifndef ONLINE_JUDGE
 freopen("input.txt", "r", stdin);
 freopen("Error.txt", "w", stderr);
 freopen("output.txt", "w", stdout);
#endif
 std::ios_base::sync_with_stdio(false);
 std::cin.tie(NULL);
 int T;
 T = 1;
 while(T-- >0) {
 	test_case();
 }
}

