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

int ans;
char s[12];

void read(int &s)
{
	s = 0; bool pd = false; char c = getchar();
	while (c < '0' || c > '9')
	{
		if (c == '-') pd = true;
		c = getchar();
	}
	while (c >= '0' && c <= '9')
	{
		s = (s << 3) + (s << 1) + (c ^ 48);
		c = getchar();
	}
	if (pd) s = -s;
	return;
}

int main()
{
	scanf("%s", s);
	for (int i = 0; i <= 11; i++)
		if (s[i] == 'Z' && s[i + 1] == 'O' && s[i + 2] == 'N' && s[i + 3] == 'e')
			ans++, i += 3;
	printf("%d", ans);
	return 0;
}
#include<bits/stdc++.h>
using namespace std;

int main(){
    string S;
    cin >> S;
    int flagZ = 0, flagO = 0, flagN = 0, flage = 0;
    int count = 0;
    for(int i = 0; i < 12; i++){
        if(S.at(i) == 'Z'){
            flagZ = 1;
            continue;
        }
        if(S.at(i) == 'O' && flagZ == 1){
            flagO = 1;
            continue;
        }
        if(S.at(i) == 'N' && flagO == 1){
            flagN = 1;
            continue;
        }
        if(S.at(i) == 'e' && flagN == 1){
            count++;
            flagZ = 0;
            flagO = 0;
            flagN = 0;
            continue;
        }

        flagZ = 0;
        flagO = 0;
        flagN = 0;
    }
    cout << count << endl;
}