#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef pair<int, int> pii;
typedef map<int, int> dictii;
typedef map<string, int> dictsi;
typedef map<string, string> dictss;
typedef pair<string, string> pss;
typedef set<int> si;
typedef set<string> ss;
typedef set<char> sc;
 
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define FOR(a,b,c) for(int a=b;a<c;a++)
#define sut(a,b) (b*(b+1)/2 - a*(a+1)/2)
#define len(a) a.size()
#define FORD(a) for(const auto &[key, value] : a)
#define reverse(a) reverse(a.begin(), a.end())
#define nodup(v) v.erase(unique(v.begin(), v.end()), v.end())
#define string(d) to_string(d)
#define MAX_SIZE 1000005
 
 
 
const int mod = 1000000007;
const int max_n = 200005;
//Notes:
// 

void solve(){
}



int main(){
    ios::sync_with_stdio(0);
    cin.tie(NULL);
string s;
int count=0;
cin >> s;
FOR(i,0,len(s)-3)
{
	if(s[i]=='Z' && s[i+1]=='O' && s[i+2]=='N' && s[i+3]=='e')
	{
		count++;
	}
}
cout << count;

    return 0;
}
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
    string s;
    string search = "ZONe";
    cin >> s;

    int count = 0;

    for (int i = 0; i < 9; i++)
    {
        //cout << s.substr(i, 4) << endl;

        if (s.substr(i, 4) == search)
            count++;
    }

    cout << count << endl;

    return 0;
}