#include<bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i, 0, n)
#define all(x) (x).begin(),(x).end()
const int INF = 1e9+1;
using namespace std;
using ll = long long;
using p = pair<int, int>;

int main() {
  string S;
  string Z = "ZONe";
  cin >> S;
  int i = 0;
  int j = 0;
  int ans = 0;
  while (true) {
    while (S[i+j] == Z[j]) {
      j++;
      if (j >= 4) {
        j--;
        ans++;
        break;
      }
    }
    i += max(1, j-1);
    if (i >= 11) break;
    j = 0;
  } 
  cout << ans << endl;
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
        string s;
        cin>>s;
int count=0;
        for(int i=0;i<12;i++)
        {
        	if(s[i] == 'Z' && s[i+1] == 'O' && s[i+2] == 'N' && s[i+3]=='e')
        		{count++;}
        }
       cout<<count<<endl;
       return 0;
}