#include<bits/stdc++.h>
using namespace std;
#define int long long
// #define ll long long
#define f(i,n) for(int i=0;i<n;i++)
#define fi(i,x,n) for(int i=x;i<n;i++)
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define rof(i,a,b) for(int i=(a);i>=(b);i--)
#define S second
#define F first
#define is insert
#define INF 1000000000
#define MOD 1000000007

void solve() {

	int n; cin >> n;

	vi a(n); f(i, n) cin >> a[i];

	vi cnt(100000, 0);

	int res = 0;

	for (int x : a)
	{
		int k = x % 200;
		res += cnt[k];
		cnt[k]++;
	}

	cout << res;

}

int32_t main() {
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif

	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
		cout << "\n";
	}
}
#include <bits/stdc++.h>
#define M 1000000007
#define fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
#define d(x) cout << #x << " " << x << "\n";
#define min(x1, x2) (x1 > x2 ? x2 : x1)
#define max(x1, x2) (x1 < x2 ? x2 : x1)
#define min3(x1, x2, x3) (x3 > min(x1, x2) ? min(x2, x1) : x3)
#define max3(x1, x2, x3) (x3 < max(x1, x2) ? max(x1, x2) : x3)
#define ll long long int
#define ul unsigned long long int
#define p pair<ll, ll>
#define ld long double
#define dv(v)                            \
    cerr << #v << "  ";                  \
    for (int i = 0; i < (v).size(); i++) \
        cerr << v[i] << " ";             \
    cerr << "\n";
#define inf INT_MAX
#define mp(x, y) make_pair(x, y)
using namespace std;

int main()
{
    fio;
    ll t, n, x, y, z, k;
    string s;
    cin >> s;
    n=0;
    for (int i = 0; i < s.size(); ++i)
    {
        string a;
        for (int j = i; j < min(s.size(), i + 4); ++j)
        {
            a.push_back(s[j]);
        }
        if (a == "ZONe")
        {
            ++n;
        }
    }
    cout<<n;
    return 0;
}