/*Author Sanjay shukla 
verdict Ac
*/
#include<iostream>
#include<string.h>
// #define endl ("\n")
#define pi (3.141592653589)

// #define int long long
#define float double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) cc.begin(), c.end()
#define rrep(i, n) for(int i=n-1;i>=0;i--)
#define rep(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr);
using namespace std;
// long long moduloMultiplication(long long a, 
//                             long long b, 
//                             long long mod) 
// { 
//     long long res = 0; // Initialize result 
  
//     // Update a if it is more than 
//     // or equal to mod 
//     a %= mod; 
  
//     while (b) 
//     { 
//         // If b is odd, add a with result 
//         if (b & 1) 
//             res = (res + a) % mod; 
  
//         // Here we assume that doing 2*a 
//         // doesn't cause overflow 
//         a = (2 * a) % mod; 
  
//         b >>= 1; // b = b / 2 
//     } 
  
//     return res; 
// } 


int32_t main(){
    fast
    string s;
    cin>>s;
   int occurrences = 0;
   std::string::size_type pos = 0;
   std::string target = "ZONe";
   while ((pos = s.find(target, pos )) != std::string::npos) {
          ++ occurrences;
          pos += target.length();
   }
   std::cout << occurrences << std::endl;
   return 0;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int p=0;
  for(int i=0;i<9;i++)
  {
    if(s[i]=='Z'&&s[i+1]=='O'&&s[i+2]=='N'&&s[i+3]=='e')
      p++;
  }
  cout<<p;
  return 0;
}