#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define sz(v) (int)v.size()
#define all(v) v.begin(), v.end()
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template < typename T_container, typename T = typename enable_if < !is_same<T_container, string>::value, typename T_container::value_type >::type >
ostream & operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << "\b\b]\n"; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << H << ", "; dbg_out(T...);}
#define watch(...) cerr << "[" << #__VA_ARGS__ << "]: [", dbg_out(__VA_ARGS__)

const int N = 200;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(nullptr);

	int n; cin >> n;
	map <int, int> mp;
	ll ans = 0;
	for (int i = 0; i < n; ++i) {
		int a; cin >> a; a %= N;
		ans += mp[a];
		mp[a]++;
	}

	cout << ans;


	return 0;
}

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <climits>
using namespace std;
typedef long long ll;

//infの設定
#define INF32 2147483647
#define INF64 9223372036854775807
//repマクロ
#define rep(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))

int main(){

    ll N,A;
    static ll a[202020];


    cin>>N;
    rep(i,0,N){
        cin>>A;
        a[i]=A%200;
        //cout<<a[i]<<" ";
    }


    sort(a,a+N);
    /*for(int i=0;i<N;i++){
        cout<<a[i]<<" ";
    }*/
    //cout<<endl;

    ll count=0;
    ll num=0;
    ll a0=a[0];
    a[N]=201;

    rep(i,1,N+1){
        if(a[i]==a0){
            num++;
            //cout<<i<<" "<<a[i]<<endl;
        }else{
            count+=(num*(num+1))/2;
            //cout<<a0<<" ga "<<num+1<<" ko"<<endl;
            num=0;
            a0=a[i];
        }
    }


    cout<<count<<endl;

    return 0;
}