#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;
map<int,int>ma;
int n,x[maxn],b[205];
int main () {
	cin>>n;
	ll ans=0;
	for(int i=0;i<200;i++) b[i]=0;
	for(int i=0;i<n;i++) {
		cin>>x[i];
		int tmp=x[i]%200;
		ans+=b[tmp];
		b[tmp]++;
	}
	cout<<ans<<endl;	
	
} 
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<ll>;
using vvll = vector<vll>;

template <typename T> constexpr int inof(const T x) {
    return static_cast<int>(x);
}
template <typename T> constexpr ll llof(const T x) {
    return static_cast<ll>(x);
}
template <typename T> constexpr double doof(const T x) {
    return static_cast<double>(x);
}

template <typename T> constexpr int sz(const T &xs) { return inof(xs.size()); }

ll pairs_num(const vi &xs) {
    vi fs(200, 0);
    ll ans = 0;

    for (const int x : xs) {
        ans += fs[x % 200];
        ++fs[x % 200];
    }

    return ans;
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin.exceptions(cin.failbit);
    cout << setprecision(9) << fixed;

    int n;
    cin >> n;

    vi xs(n);
    for (auto &x : xs) cin >> x;

    cout << pairs_num(xs) << '\n';

    return 0;
}
