#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define start() int t;cin>>t;while(t-->0) 
#define speed ios_base::sync_with_stdio(false);   cin.tie(NULL);   cout.tie(NULL);
#define endl "\n" 
#define mod 1000000007

bool isPrime(int n) 
{ 
    // Corner cases 
    if(n<=3){
        return true;
    }
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
}



int main()
{
   speed;
   ll n;
   cin>>n;
   ll a[n];
   map<ll,ll> m;
   for(int i=0;i<n;i++){
       cin>>a[i];
       m[a[i]%200]++;
   }
   ll sum=0;
   for(auto x:m){
       if(x.second>1){
           sum+=(x.second*(x.second-1))/2;

       }
   }
   cout<<sum;
   return 0;
}
#include "bits/stdc++.h"
using namespace std;

#define ll long long int 
#define pb(a) push_back(a)
#define vll vector<ll>
#define loop(i, n) for(ll i=1;i<=n;i++)
#define loop0(i, n) for(ll i=0;i<n;i++)
#define in(i) scanf("%lld", &i);
#define out(i) printf("%lld", i)
#define pll pair<ll, ll>
#define vpll vector<pair<ll, ll>>
#define mp(i, j) make_pair(i, j);
const ll mod = 1000000007;
const ll big = 2999999999999999999;
const ll small = -2999999999999999999;
void in2(ll& a, ll& b) { in(a); in(b); }
void in3(ll& a, ll& b, ll& c) { in(a); in(b); in(c); }
void swap(ll& a, ll& b) { a = a+b; b = a-b; a = a-b; }
void arrayIn(vll& a, ll& n) { loop0(i, n) in(a[i]); }

ll n;

int main()
{
  in(n);
  vll counter(200, 0);
  ll ip;
  loop0(i, n)
  {
    in(ip);
    counter[ip%200] += 1;
  }
  ll ans = 0;
  loop0(j, 200)
  {
    ll i = counter[j];
    ans += (i*(i-1)/2);
  }
  cout<<ans<<"\n";
}
