#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main()
{
  ull n, a; cin >> n;
  ull ans = 0;
  vector<ull> mod(200);
  rep(i, n)
  {
    cin >> a;
    mod.at(a % 200)++;
  }
  rep(i, 200)
  {
    if (mod.at(i) > 0) ans += mod.at(i) * (mod.at(i)-1) / 2;
  }
  cout << ans << endl;
}


# include <bits/stdc++.h>
using namespace std;

# define endl "\n"
# define io_boost std::ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
typedef unsigned long long int ulli;
typedef long long int lli;
typedef unsigned int ui;

int N, A[200005];

int main(){
    cin >> N;
    for(int i = 0; i < N; i++) cin >> A[i];
    int m[200] = {0};
    lli ans = 0;
    for(int i = 0; i < N; i++)
        ans += m[A[i] % 200], m[A[i] % 200]++;
    cout << ans << endl;
    return 0;
}