#include <bits/stdc++.h>
#define pb push_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define f(i,b) for(int i=0;i<b;i++)
#define int long long
using namespace std;

void solve()
{
   int n;
   cin>>n;
    int a[n];

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

    int ans=0;
    map<int,int> mp;

    for(auto z:a)
    {
        ans+=mp[z];
        mp[z]++;
    }
   cout<<ans<<"\n";
    return;
}

signed main()
{
    int t=1;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //cin>>t;


    while(t--)
    {
        solve();
    }
        return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define deb(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
 
typedef long long int ll;
typedef string str;
 
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 
 
ll nCrModP(ll n, ll r, ll p) 
{ 
    if (!r) 
      return 1; 
  
	ll fac[n+1]; 
   	fac[0] = 1; 
    for (ll i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* power(fac[r], p-2,p) % p * power(fac[n-r], p-2,p) % p) % p; 
}
 
ll gcd(ll a, ll b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);
}
 
void fast(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

int main ()
{
	
	ll t,n,m,k,i,j,a,b;
	// cin >> t;
    str st,s;
    cin >> n;
    ll h[201]={0};
    for(i=0;i<n;i++)
    {
        cin >> a;
        a%=200;
        h[a]++;
    }
    b = 0;
    for(i=0;i<200;i++)
    {
        a = h[i];
        b += (a*(a-1))/2;
    }
    cout << b << "\n";
    return 0;
}