#include <bits/stdc++.h>
using namespace std;

int main()
{
    string S;
    cin >> S;
    int counter = 0;
    for(int i=0;i<9;i++)
    {
        if(S.at(i)=='Z')
        {
            if(S.at(i+1) == 'O')
            {
                if(S.at(i+2) == 'N')
                {
                    if(S.at(i+3) == 'e') counter++;
                }
            }
        }
    }
    cout << counter << endl;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;
    int n=0,ans=0;
    while(s.find("ZONe",n)!=string::npos){
        n=s.find("ZONe",n)+4;
        ans++;
    }
    cout << ans << endl;

}