#include <iostream>
using namespace std;
#include<bits/stdc++.h>
#define ll long long 
#include <iomanip>
 
 


void solve()
{
    
    
    ll int n;
    cin>>n;
    ll int arr[n];
    
    ll int count=0;
    
    unordered_map<ll int,ll int> m; 
    for(ll int i=0;i<n;i++)
    {
        cin>>arr[i];
        
        if(arr[i]>=200)
        {
            m[arr[i]%200]++;
        }
        else
        {
            m[arr[i]]++;
        }
    }
    
    
    for(auto i:m)
    {
        ll int x=i.second;
        if(x>1)
        {
            count+=(x*(x-1)/2);
        }
    }
    
    cout<<count<<endl;
         
       
}
  
  
  
 int main() 
 {
    // ll int t;
    // cin>>t;
    
    // while(t--)
    // {
    //     solve();
    // }
    
    solve();
    
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)
#define repd(i, n) for (int i = n-1; i >= 0; i--)
#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
//V,Pは大文字i,l,bは小文字
using ll = long long;
using Vi = vector<int>;
using VVi = vector<Vi>;
using Vl = vector<ll>;
using VVl = vector<Vl>;
using Vb = vector<bool>;
using VVb = vector<Vb>;
using P = pair<int,int>;
using Pl = pair<ll, ll>;
using Vs = vector<string>;
const ll mod = 1000000007;
const ll inf = 1000000000000000000;//10の18乗
#define yn {puts("Yes");}else{puts("No");}
#define dame { puts("-1"); return 0;}

int main() {
    ll n;
    cin >> n;
    ll ans=0;
    Vl v(n);
    rep(i,n) cin >> v[i];
    Vl cnt(250);
    rep(i,n) cnt[(v[i])%200]++;
    rep(i,250){
        ans+=cnt[i]*(cnt[i]-1)/2;
    }
    cout << ans << endl;
}
