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

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll n , m , t, i , j , k ;
    cin >> n ; 
    ll a[n] ; 
    for(i=0;i<n;i++)
    {
        cin >> a[i] ; 
    }
    map<ll, ll> mp ; 
    ll ct = 0 ; 
    for(i=0;i<n;i++)
    {
        ll temp = ((a[i])%200) ; 
        mp[temp]++ ; 
    }
    for(auto it: mp)
    {
        if((it.second) >= 2)
        {
            ct+= ((it.second)*(it.second - 1))/2 ; 
        }
    }
    cout << ct ; 
  return 0 ;
}
#include <bits/stdc++.h>
using namespace std;

struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast;

using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vl = vector<long>;
using vll = vector<long long>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvll = vector<vll>;
using vs = vector<string>;
using pii = pair<int, int>;

#define pb push_back
#define mp make_pair
#define YESNO(bool) if(bool){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(bool) if(bool){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) reps(i, 0, n)
#define rrep(i, n) reps(i, 1, n + 1)
#define repd(i,n) for(ll i=n-1;i>=0;i--)
#define rrepd(i,n) for(ll i=n;i>=1;i--)

#define debug(x) cerr << "\033[33m(line:" << __LINE__ << ") " << #x << ": " << x << "\033[m" <<endl;
#define kd(x) cerr << "\033[33m" << #x << ": " << x << ", \033[m";
#define kdl(x) cerr << "\033[33m(line:" << __LINE__ << ") " << #x << ": " << x << ", \033[m";
#define kde(x) cerr << "\033[33m" << #x << ": " << x << ", \033[m" << endl;

inline int in_int() {int x; cin >> x; return x;}
inline ll in_ll() {ll x; cin >> x; return x;}
inline string in_str() {string x; cin >> x; return x;}
template <typename T> inline bool chmin(T& a, const T& b) {bool compare = a > b; if (a > b) a = b; return compare;}
template <typename T> inline bool chmax(T& a, const T& b) {bool compare = a < b; if (a < b) a = b; return compare;}

int main()
{
    int n = in_int();
    vll b(200, 0);
    rep(i,n) b[in_int() % 200]++;
    ll ans = 0;
    rep(i,200) {
        if (b[i]>=2) {
            ans += b[i] * (b[i] - 1) / 2;
        }
    }
    cout << ans;
    return 0;
}
