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

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a.at(i);

    vector<ll> counter(200, 0);
    rep(i, n)
    {
        counter.at(a.at(i) % 200)++;
    }

    ll ans = 0;
    rep(i, counter.size())
    {
        ll cnt = counter.at(i);
        ans += cnt * (cnt - 1) / 2;
    }

    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0; i<(n); ++i)
#define fixed_setprecision(n) fixed << setprecision((n))
#define execution_time(ti) printf("Execution Time: %.4lf sec\n", 1.0 * (clock() - ti) / CLOCKS_PER_SEC);
#define pai 3.1415926535897932384
#define NUM_MAX 2e18
#define NUM_MIN -1e9
 
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmax(T& a, T b){ if(a<b){ a=b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b){ if(a>b){ a=b; return 1; } return 0; }

void solve(ll N, map<int, int> m){
    ll res=0;
    for(int i=0; i<200; i++){
        for(int j=i; j<200; j++){
            if(m[i]==0 || m[j]==0) continue;
            if((j-i)%200==0){
                if(i==j){
                    rep(k, m[i]){
                        res += (m[i]-k-1);
                    }
                }
            }
        }
    }
    cout << res << endl;
}

int main() {
    ll N;
    cin >> N;
    //N = 200000;

    //vector<ll> A(N);
    map<int, int> m;
    rep(i, N){
        ll t;
        cin >> t;
        m[t%200]++;
    }
    //rep(i, N) cin >> A[i];
    //rep(i, N) A[i]=400;

    solve(N, m);

    return 0;
}