#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;


int main()
{
    string s;
    cin>>s;
    int i=0;
    int cnt=0;
    while(i<9)
    {
        if(s[i] == 'Z')
        {
            if((s[i+1] == 'O') && (s[i+2] == 'N') && (s[i+3] == 'e'))
            {
                i+=4;
                cnt++;
            }
            else 
            i++;
        }
        else 
        i++;

    }

    cout<<cnt<<endl;

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s; cin >> s;
  int t = 0;
  for (int i = 0; i <= s.size() - 4; i++) 
    if (s.substr(i, 4) == "ZONe") t++;
  cout << t << endl;
  return 0;
}
