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

#define PI double(2 * asin(1.0))
#define ll long long
#define MOD 1000000007
#define INF 1e15

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n;
	cin >> n;
	ll a[n];
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
		a[i] %= 200;
	}
	
	unordered_map<int, int> umap;
	int64_t cnt = 0;
	for (int i = 0; i < n; ++i)
		umap[a[i] - 200]++;

	for (auto x : umap)
	{
		cnt += ((long long)x.second * (x.second - 1)) / 2;
	}
	cout << cnt << endl;
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)//iをaからn
#define per(i,n,a) for (int i=a-1;i>=n;i--)//iをnからa
#define db(x) cout << #x << " = " << x << endl//デバッグ用
#define db2(x, y) cout << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"; //デバッグ用
#define all(x) (x).begin(), (x).end()
#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf
#define INF64 9223372036854775807 //9.223372036854775807×10^{18}:64bit整数のinf
#define MOD 1000000007 //10^9+7:合同式の法
#define pb push_back
#define F first
#define S second
typedef long long ll;

//sort(all(a)); ソート
//sort(all(a),greater<int>()); 逆順ソート
//a.erase(unique(all(a)), a.end()); ソート後に重複を削除
//cout<< std::fixed << std::setprecision(15)<<0.000001<<endl; 小数点以下を表示させる
//vector<vector<int>> data(3, vector<int>(4)); int型の2次元配列(3×4要素の)の宣言    


int main() {
    ll n;
    cin>>n;
    vector<ll> amari(200);
    ll aaa;
    rep(i,0,n){
    cin>>aaa;
    amari.at(aaa%200)++;
    }
    ll ans=0;
    rep(i,0,200){
        //cout<<amari.at(i)<<" ";
    ans+=((amari.at(i)-1)*amari.at(i))/2;
    }
    cout<<ans;
}