#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
typedef long long ll;
typedef long double ld;
const ll INF = 9223372036854775807;
const ll MOD = 1000000007;
const long double PI = acos(-1);
#define mp make_pair
#define all(v) v.begin(), v.end()
#define F first
#define S second
typedef vector<ll> vi;
typedef map<int, int> mii;
typedef vector<vi> vvi;

 //debugger
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

// debugger end
//global variables


//functions 

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //int test;
   // cin>>test;
   // while(test--)
   // {
    //    solve();
    //}

    ll n;
    cin>>n;


    vi arr;

    rep(i,0,n)
    {
        ll temp;
        cin>>temp;
        arr.pb(temp%200);
    }


    map <ll,ll> freq;

    rep(i,0,n)
    {
        freq[arr[i]]++;
    }

    ll ans=0;


    for(auto it:freq)
    {
        ans+=it.second*(it.second-1)/2;
    }

    cout<<ans<<endl;

 



 return 0;
}
#include <bits/stdc++.h>
typedef long long int ll;
#define fr(i, a, b) for (int i = a; i <= b; i++)
#define mset(arr) memset(arr, 0, sizeof(arr))
#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL)
#define mod 1000000007
using namespace std;

ll powrmod(ll a, ll b, ll m)
{
    ll pdt = 1;
    if (b == 0)
        return 1;
    else if (b % 2 == 0)
        return powrmod((a * a) % m, b / 2, m);
    else
        return (a * powrmod((a * a) % m, (b - 1) / 2, m)) % m;
}

void solve()
{
    int n;
    cin >> n;
    ll arr[n];
    fr(i, 0, n - 1) cin >> arr[i];
    ll hash[200];
    mset(hash);
    for (int i = 0; i < n; i++)
    {
        hash[arr[i] % 200]++;
    }
    ll cnt = 0;
    for (int i = 0; i < 200; i++)
    {
        cnt += hash[i] * (hash[i] - 1) / 2;
    }
    cout << cnt;
}

int main()
{

    ll t = 1;
    // cin>>t;
    while (t--)
    {
        solve();
        cout << endl;
    }

    return 0;
}