#include <iostream>
#include <vector>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N),mod_200(N);
    for(int n=0;n<N;n++) cin >> A[n];

    for(int n=0;n<N;n++) mod_200[n] = A[n]%200;
    vector<long long> num_pairs(200,0);
    for(int n=0;n<N;n++) num_pairs[mod_200[n]]++;
    long long ans = 0;
    for(int i=0;i<200;i++){
        if(num_pairs[i]>1){
            ans += (num_pairs[i]-1)*(num_pairs[i])/2;
        }
    }
    cout << ans << endl;
    return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
 
#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
 
void solve() {
    int n;
    cin >> n;
    int cnt[200] = {0};
    ll ans = 0;
    fori (i, 0, n) {
        int x;
        cin >> x;
        int m = x % 200;
        ans += cnt[m];
        cnt[m]++;
    }
    cout << ans << endl;
}
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}
