#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;
using ll = long long;

int main(){
    ll n; cin >> n;
    ll a[n], mod[200] = {0};
    
    for (ll i = 0; i < n; i++){
        cin >> a[i];
    }

    for (ll i = 0; i < n; i++) {
        mod[a[i]%200]++;
    }

    ll ans = 0;
    for (ll i = 0; i < 200; i++){
        ans += (mod[i] * (mod[i]-1))/2;
    }

    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>             /*Fuck ratings Feel the magic in the code...*/
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
// template<typename T>
// using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/*   in log(n) time...
    find_by_order() - Returns an iterator to the k-th largest element (counting from zero)
    order_of_key()  - The number of items in a set that are strictly smaller than our item
    // Rest same as set
*/
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod 1000000007
#define inf 2e18
#define minf -2e18
#define PI 3.141592653589793238462
#define ll long long
#define all(x) x.begin(), x.end()
#define min3(a, b, c) min(min(a, b), c)
#define max3(a, b, c) max(max(a, b), c)
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back
#define sz(v) (int)v.size()
#define nline "\n"

ll powr(ll a, ll b, ll p) { if(b == 0) return 1; else if(b == 1) return a; else if(!(b & 1)) return powr((a * a) % p, b / 2, p); else return (a * powr(a, b - 1, p)) % p; }
ll gcd(ll a, ll b){ if(b == 0) return a; else return gcd(b, a % b); }
ll lcm(ll a, ll b){ return a * b / gcd(a, b); }
void extendgcd(ll a, ll b, ll *v) {if (b == 0) {v[0] = 1; v[1] = 0; v[2] = a; return ;} extendgcd(b, a % b, v); ll x = v[1]; v[1] = v[0] - v[1] * (a / b); v[0] = x; return;} //pass an arry of size1 3
ll mminv(ll a, ll b) {ll arr[3]; extendgcd(a, b, arr); return arr[0]; } //for non prime b
ll mod_inv(ll a, ll p){ return powr(a,p-2,p); } /*For prime p  "Fermet lill theorem"*/
ll mod_add(ll a, ll b, ll m) { a = a % m; b = b % m; return ((a + b) % m + m) % m; }
ll mod_mul(ll a, ll b, ll m) { a = a % m; b = b % m; return ((a * b) % m + m) % m; }
ll mod_sub(ll a, ll b, ll m) { a = a % m; b = b % m; return ((a - b) % m + m) % m; }
ll mod_div(ll a, ll b, ll m) { a = a % m; b = b % m; return (mod_mul(a, mod_inv(b, m), m) + m) % m; } /*For prime p*/
// void swap(int &a, int &b) { int temp = a; a = b; b = temp; }
ll spf(ll n) { for(int i = 2; i * i <= n; i++) { if(n % i == 0) return i; } return n; }/* spf in sqrt(n) time... */
vector<ll> fact_modp(ll n, ll p) { vector<ll> fact(n + 1); fact[0] = 1; for(int i = 1; i <= n; i++){ fact[i] = (i * fact[i - 1]) % p; } return fact; }
/*For prime p "Fermet lill theorem..."*/
ll nCr_modp(ll n, ll r, ll p, vector<ll> fact) {  if(n < r) return 0; if(r == 0) return 1; else { return ((fact[n] * mod_inv(fact[r], p)) % p * mod_inv(fact[n - r], p)) % p; } }


vector<ll> prime_sieve(ll n) { /*Returns vector of prime <= n  in nloglogn time*/
    vector<ll> t;
    vector<bool> a(n + 1, true);
    a[0] = a[1] = false;
    for(int i = 2; i * i <= n; i++) {
        if(a[i]) {
            for(int j = i * i; j <= n; j += i)
            a[j] = false;
        }
    }
    for(int i = 0; i <= n; i++) {
        if(a[i])
        t.push_back(i);
    }
    return t;
}
vector<ll> spf_sieve(ll n) { /*Returns vector of spf[n] in nloglogn time*/
    vector<ll> a(n + 1, -1);
    for(int i = 2; i * i <= n; i++) {
        if(a[i] == -1) {
            a[i] = i;
            for(int j =i * i; j <= n; j += i) { if(a[j] == -1) a[j] = i;}
        }
    }
    for(int i = 2; i <= n; i++) { if(a[i] == -1) a[i] = i;}
    return a;
}
     /* --------------------------------------Template ends, Dee codes---------------------------------------*/

int main()
{
    fastio();

    int tests = 1;
    // cin >> tests;                  
    while(tests--)
    {
    	int n;
    	cin >> n;
    	vector<int> a(n);
    	ll res = 0;
    	map<int, ll> mp;
    	for(int i = 0; i < n; i++) {
    		cin >> a[i];
    		int r1 = (200 - (a[i] % 200));
    		if(r1 != 200) {
    			res += mp[200 - r1];
    		}
    		mp[a[i] % 200]++;
    	}
    	res += ((mp[0] * (mp[0] - 1)) / 2);
    cout << res << nline;

    }
    return 0;
}
