#include <iostream>
#include<string>
#include <vector>
#include <iomanip>
#include <stdio.h>
#include <math.h>

using namespace std;
int main()
{
    int n;
    string s;
    cin >> s;
    int result = 0;
    for (int i = 0; i < 9; i++)
    {
        if(s[i] == 'Z'){
            if(s[i+1] == 'O'){
                if(s[i+2] == 'N'){
                    if(s[i+3] == 'e'){
                        result++;
                    }
                }
            }
        }
    }
    
    cout << result << endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
 
#define rep(i,a,b) for(int i=a;i<b;i++)
#define ll long long int
#define test() int tt; cin>>tt; while(tt--) 
#define fst_io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl '\n'
#define lg 1000000000
#define vec vector<int>
void arrInput(int a[],int n){rep(i,0,n) cin>>a[i];}

void solve()
{
  string s;	
  int c=0;
  cin>>s;;
  for(int i=0; i<=s.size()-4; i++)
  {
    if(s[i]=='Z' && s[i+1]=='O' && s[i+2]=='N' && s[i+3]=='e')
    	c++;
  }
  cout<<c;
}

int main()
{
  solve();	
}