#include <bits/stdc++.h>
#include <stdio.h>
#define ll int64_t
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define rev(i, a, n) for (ll i = a; i >= n; i--)
#define sz size()
#define ff first
#define ss second
#define vec vector<ll>
#define vecpair vector<pair<ll, ll>>
#define pb push_back
#define po pop_back
#define mk make_pair
#define all(a) a.begin(), a.end()
#define fill(a, b) memset(a, b, sizeof(a))
#define debug(v) cout<<"DEBUG["; rep(i,0,v.sz) cout<<v[i]<<","; cout<<"]"<<endl;
#define mod 1000000007
#define endl '\n'
#define zero cout << "0" << endl
#define mone cout << "-1" << endl
#define p(x) cout << x << endl
#define onescount(x) __builtin_popcountll(x)
// (ll for long long) count the number of one’s(set bits) in an integer.
#define lzero(x) __builtin_clzll(x)
//count the leading zeros of the integer
#define tzero(x) __builtin_ctzll(x) :
//to count the trailing zeros of the given integer
#define ckparity(x) builtin_parityll(x)
// to check the parity of a number (eg: 7-> 111 ->> odd parity ->> return 1 else return 0)
const int N = 2e5 + 1;
using namespace std;
// ll h[N];
// if declaring variable in global space show ambigous than change the varibale name
// const ll inf = 1e18;

// ceil(a/b) = (a+b-1)/b
// floor(a/b) = (a/b)

/* ascii value
A=65,Z=90,a=97,z=122
*/
/*  -----------------------------------------------------------------------------------*/
// int to char --> suppose int x  char y=x+'0'
// char to int --> suppose char x  int y=x-'0'

// struct cmp {
//   bool operator() (const pair<ll, ll> &a, const pair<ll, ll> &b) const {
//     int lena = a.ss - a.ff + 1;
//     int lenb = b.ss - b.ff + 1;
//     if (lena == lenb) return a.ff < b.ff;
//     return lena > lenb;
//   }
// };

ll ceil(ll a, ll b) {
  ll res = (a + b - 1) / b;
  return res;
}
ll str_to_num(string s) {
  return stoi(s);
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
string num_to_str(ll num) {
  return to_string(num);
}

bool isPrime(int x) {
  if (x < 2) return false;
  for (int y = 2; y * y <= x; y++)
    if (x % y == 0)
      return false;
  return true;
}
double rnd(double var)
{
  // 37.66666 * 100 =3766.66
  // 3766.66 + .5 =3767.16    for rounding off value
  // then type cast to int so value is 3767
  // then divided by 100 so the value converted into 37.67
  double value = (int)(var * 100 + .5);
  return (double)value / 100;
}
bool check(string s) {
  string t = s;
  reverse(all(s));
  return t == s;
}

// / a & b & c & d = min(a, b, c, d)

ll fact[N + 1];
void factorial()
{
  fact[0] = 1;
  for (int i = 1; i <= N; i++)
  {
    fact[i] = (fact[i - 1] * i) % mod;
  }
}
/// code goes here
void build() {

}
void solve()
{
  ll n; cin >> n;
  vec cnt(200, 0);
  rep(i, 0, n) {
    ll x; cin >> x;
    cnt[x % 200]++;
  }
  ll ans = 0;
  rep(i, 0, 200) {
    ans += (cnt[i] * (cnt[i] - 1)) / 2;
  }
  cout << ans << endl;
}
int main()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  // prime();
  // factorial();
  // ll t;
  // cin >> t;
  // rep(i, 0, t)
  // {
  // cout << "Case #" << i + 1 << ": ";
  solve();
  // }
  return 0;
}

#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define int long long

constexpr int N = 200;

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    array<int, N> modcount{};

    for (auto &&i : a) {
        modcount[i % N]++;
    }

    int ans = 0;

    for (auto &&i : modcount) {
        ans += i * (i - 1) / 2;
    }

    cout << ans << "\n";
}
