#include <bits/stdc++.h>
typedef long long ll;
#define _GLIBCXX_DEBUG
#define int long long
using namespace std;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MAXIN(x) max_element(ALL(x)) - x.begin();
#define MIN(x) *min_element(ALL(x))
#define MININ(x) min_element(ALL(x)) - x.begin();
#define INF 1000000000000
#define MOD 1000000007
#define MAXR 100000  //10^5:配列の最大のrange(素数列挙などで使用)
#define PI 3.14159265358979323846

using namespace std;

uintmax_t combination(unsigned int n, unsigned int r) {
    if (r * 2 > n) r = n - r;
    uintmax_t dividend = 1;
    uintmax_t divisor = 1;
    for (unsigned int i = 1; i <= r; ++i) {
        dividend *= (n - i + 1);
        divisor *= i;
    }
    return dividend / divisor;
}

signed main() {
    int n;
    cin >> n;
    vector<int> A(n);
    vector<int> B(200);
    REP(i, n) {
        cin >> A[i];
        B[A[i] % 200]++;
    }

    int ans = 0;
    for (int i = 0; i < 200; i++) {
        if (B[i] > 1) {
            //ans += comb(B[i], 2)[B[i]][2];
            ans += combination(B[i], 2);
        }
    }
    cout << ans << endl;
}
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<long long> remainder(200);
    for(int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        remainder[a % 200]++;
    }
    long long count = 0;
    for(int i = 0; i < 200; ++i) count += remainder[i] * (remainder[i] - 1) / 2;
    cout << count << endl;
    return 0;
}
