//* Jai shree Ram
#include <bits/stdc++.h>  
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define lli                                 long long int
#define ll                                  long long
#define FOR(i,a,b)                          for(int i=(a);i<(b);i++)
#define vi                                  vector<int>
#define vll                                 vector<ll>
#define all(a)                              a.begin(),a.end()
#define sz(a)                               (int)a.size()
#define pb                                  push_back
#define ppb                                 pop_back
#define pf                                  push_front
#define fr                                  first
#define sc                                  second
#define uniq(v)                             (v).erase(unique(all(v)),(v).end())
using namespace std;

void __print(int x) {cerr << x;}void __print(long x) {cerr << x;}void __print(long long x) {cerr << x;}void __print(unsigned x) {cerr << x;}void __print(unsigned long x) {cerr << x;}void __print(unsigned long long x) {cerr << x;}void __print(float x) {cerr << x;}void __print(double x) {cerr << x;}void __print(long double x) {cerr << x;}void __print(char x) {cerr << '\'' << x << '\'';}void __print(const char *x) {cerr << '\"' << x << '\"';}void __print(const string &x) {cerr << '\"' << x << '\"';}void __print(bool x) {cerr << (x ? "true" : "false");}template<typename T, typename V>void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}void _print() {cerr << "]\n";}template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
// __builtin_popcountll(x);
// __builtin_clz(x) // Count Leading zeros
// __builtin_ctz(x) // Trailing zeros
const int MM = 998244353;
const int mod = 1e9 + 7;
const int INF = 1e9 + 5;
const int N = 1e5 + 5;


void solve() 
{
    int n;
    cin >> n;
    vll a(n);
    map<ll,ll> mpp;
    for(ll &x : a) {
        cin >> x;
        mpp[x%200]++;
    }
    ll ans = 0;
    for(auto x : mpp) {
        ans += x.sc*(x.sc-1)/2;
    }
    cout << ans << "\n";

}

signed main()
{
    ios;
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #ifdef SIEVE
          sieve();
    #endif
    #ifdef NCR
          init();
    #endif
    int t;
    t=1;
    // cin>>t;
    while(t--)
    {
        solve();
    }
}
/* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * remember out of bounds case mainly in if else
  * do smth instead of nothing and stay organized
  * WRITE STUFF DOWN
*/
#include <vector>
#include <stdio.h>
using namespace std;
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int,int>;
#define pcnt __builtin_popcount//1ビットがたっている数を数える

int main() {
	int n;
	cin >> n;
	int a[n];
	ll b[200] = {0};
	rep(i,n)
	{
		cin >> a[i];
		b[a[i]%200]++;
	}

	ll ans = 0;
	rep(i,200)
	{
		ans += (b[i]*(b[i]-1))/2;
	}
	cout << ans << endl;
	return 0;
}