#include <iostream>
#include <unordered_map>

int main()
{
  int N;
  std::cin>>N;
  
  std::unordered_map<int,int>m;
  for(int i=0;i<N;i++)
  {
    int A;
    std::cin>>A;
    m[A%200]++;
  }
  
  int64_t res=0;
  for(int i=0;i<200;i++)
  {
    int64_t e=m[i];
    res+=e*(e-1)/2;
  }
  
  std::cout<<res<<std::endl;
  
  return 0;
}
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define forn(i,n) for(int i=0;i<n;i++)
#define pb emplace_back
#define sz(x) ((int) (x).size())
#define dbg(x) cerr << #x << "->" << x << "\n";

int gcd(int a, int b) {if (b == 0) return a; return gcd(b, a % b);}
int mod = (int)1e9 + 7;

void solve() {
	int n; cin >> n; int a[n];
	forn(i, n)cin >> a[i];
	int mo[n];
	forn(i, n) mo[i] = a[i] % 200;
	map<int, int> f;
	forn(i, n) {
		f[mo[i]]++;
	}
	int ans = 0;
	for (auto i : f) {
		ans += (i.second * (i.second - 1)) / 2;
	}
	cout << ans;
}

int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	int t = 1;
	// cin >> t;
	forn(i, t)
	solve();
	return 0;
}