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

int main(){
  long long N = 0;
  long long cnt = 0;
  long long cmb = 0;


  cin >> N;
  vector<long long> A(N);
  vector<long long> B(N);
  for(int i=0; i<N; i++){
    cin >> A.at(i);
    B.at(i) = A.at(i) % 200;
  }

  for(int j=0; j<200; j++){
    cmb = 0;
    for(int i=0; i<N; i++){
      if(j == B.at(i)) cmb++;
    }
    if(cmb>0)cnt = cnt + cmb*(cmb-1)/2;
  }


  cout << cnt << endl;
}
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author NikuKyabe
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define REV(i, a, b) for (int i = (b) - 1; i >= (a); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001l
#define MOD 1000000007
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class comb_n{
private:
void comb_num(int n, int k, int ans = 0, int i = 0){
    if(i == k){
        _comb = ans;
        return;
    }
    if(i == 0){
        comb_num(n, k, ans + n, i+1);
    }
    else{
        comb_num(n, k, ans * (n - i) / (i + 1), i+1);
    }
    return;
}
public:
    int _comb;//この値を使う
    comb_n(int n, int k){
        comb_num(n, k);
    }
};

class CRingosFavoriteNumbers2 {
public:
	void solve(std::istream& cin, std::ostream& cout) {
        int n;
        cin >> n;
        vector<int> a(n);
        REP(i,n) cin >> a[i];

        map<int, int> m;
        REP(i,n){
            m[a[i]%200]++;
        }
        int ans = 0;
        for(auto itr = m.begin(); itr != m.end(); itr++){
            auto cn = comb_n(itr->second, 2);
            ans += cn._comb;
        }
        cout << ans << endl;
	}
};

signed main() {
	CRingosFavoriteNumbers2 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}
