#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n";
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
#define nline cout<<"\n"
#define len(a) sizeof(a)/sizeof(a[0])
template<typename T> void debug(vector<T> &array, bool IsSorted) {if (IsSorted) sort(all(array)); for (auto &i : array) {cerr << i << " ";} cerr << '\n';}
template<typename T> void deb(T &i, T &j) { cerr << "{" << i << " , " << j << "}" << endl;}
void solve(); signed main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin); freopen("debug.txt" , "w" , stderr);
#endif
	ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); solve();
}
//----------------------------Harsh Samoliya.cpp-----------------------//
void solve() {
	string s;
	cin >> s;
	int count = 0;
	int ans = 0;
	string l = "ZONe";
	for (int i = 0; i < s.size() - 3; i++) {
		int count = 0;
		int val = i;
		for (int j = 0 ; j < l.size(); j++) {
			if (s[val] == l[j]) {
				val++;
				count++;
				if (count == 4) {
					ans++;
				}
			} else {
				break;
			}
		}
	}
	cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long ll;

int main()
{
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    string str;
    cin >> str;
    int cnt = 0;
    for (int i = 0; i < 9; i++)
        if (str[i] == 'Z' && str[i + 1] == 'O' && str[i + 2] == 'N' && str[i + 3] == 'e')
            cnt++;
    cout << cnt << endl;
    return 0;
}