#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define int long long
#define reset(x) memset(x,0,sizeof(x))
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define sz(a) (int)a.size()
#define pii pair<int,int>
#define all(a) a.begin(),a.end()
#define PI 3.1415926535897932384626433832795
#define INF 1000000000
#define MOD 1000000007
#define MOD2 1000000009
#define EPS 1e-6 
#define pb push_back
#define fi first
#define se second
#define mp make_pair
 
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};


signed main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	//freopen(".inp", "r", stdin);
    //freopen(".out", "w", stdout);
    int n; cin >> n;
    vector<int> arr;
    map<int, int> cnt;
    for (int i = 0; i < n; i++)
    {
    	int a; cin >> a;
    	arr.pb(a);
    	if (cnt.count(a % 200) == 0)
    	{
    		cnt[a % 200] = 0;
    	}
    	cnt[a % 200]++;
    }
    int sum = 0;
    for (auto x : cnt)
    {
    	int num = x.se;
    	sum += ((num * (num - 1)) / 2);
    }
    cout << sum;
}

#include <bits/stdc++.h>
#define endl "\n"
using namespace std;

#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 0x20000000;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}


void execute()
{
    ll N;
    ll A[200000];

    cin >> N;

    vector<int> idxs[200];

    for(int i = 0; i < N; i++){
        cin >> A[i];
        idxs[A[i] % 200].push_back(i);
    }

    ll cnt = 0;
    for(int m = 0; m < 200; m++){
        vector<int> &a = idxs[m];
        ll n = a.size();
        cnt += n * (n-1) / 2;
    }

    cout << cnt << endl; 
}
