#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pai arccos(-1);
#define keta(n) cout << fixed << setprecision((n));
using ll = long long;
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a, end())
typedef long long int ll;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<vector<ll>> vvll;
typedef long double ld;
const int INF = 1 << 30;
const ll MOD = 1000000007;

int main(){
    string s;
    cin>>s;
    int count=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='Z'&&s[i+1]=='O'&&s[i+2]=='N'&&s[i+3]=='e'){
            count++;
        }
    }
    cout << count << endl;

}


// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
/********************************************************************/
#define M1 1000000007
#define M2 998244353
const double pi = 3.14159265;

#define ll long long
#define lld long double

#define pb push_back
#define mp make_pair
#define vi vector<ll>

#define endl '\n'

#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl

#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define collect(v, n)            \
    for (ll i = 0; i < n; i++) { \
        cin >> v[i];             \
    }

#define prv(v)                         \
    for (auto x : v) cout << x << " "; \
    cout << endl;
#define prmap(v) \
    for (auto x : v) cout << x.first << " " << x.second << endl;
#define prpair(x) cout << x.first << " " << x.second << endl;

/*
__builtin_popcount(n)      // the number of ones in the int
__builtin_popcountll(n)  // the number of ones in the ll

__builtin_parity(n)  // the parity (even or odd) of the number of ones

__builtin_clz(n)  // the number of zeros at the beginning of the number

__builtin_clzll(n)  // the number of zeros at the beginning of the ll
__builtin_ctz(n)  // the number of zeros at the end of the number
*/

// template <typename T>
// #define o_set(T)                                   \
        //     tree<T, null_type, less_equal<T>, rb_tree_tag, \
        //          tree_order_statistics_node_update>
// member functions :
// 1. order_of_key(k) : number of elements strictly lesser than k
// 2. find_by_order(k) : k-th element in the set
// MULTISET ==> less_equal
// SET ==> less

ll powM(ll x, ll y, ll m) {
    ll ans = 1, r = 1;
    x %= m;
    while (r > 0 && r <= y) {
        if (r & y) {
            ans *= x;
            ans %= m;
        }
        r <<= 1;
        x *= x;
        x %= m;
    }
    return ans;
}

int add(int a, int b) {
    a += b;
    if (a >= M2) a -= M2;
    return a;
}

int mul(int a, int b) { return a * 1ll * b % M2; }

int binpow(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1) res = mul(res, a);
        a = mul(a, a);
        b >>= 1;
    }
    return res;
}

map<long long, long long> factorize(long long n) {
    map<long long, long long> ans;
    for (long long i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ans[i]++;
            n /= i;
        }
    }
    if (n > 1) {
        ans[n]++;
        n = 1;
    }
    return ans;
}

ll countBits(ll n) {
    ll count = 0;
    while (n) {
        count++;
        n >>= 1;
    }
    return count;
}

ll isP(ll n) {
    if (n == 0 || n == 1) return 0;
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

ll min(ll a, ll b) {
    if (a < b) return a;
    return b;
}

ll gcd(ll x, ll y) {
    if (x == 0) return y;
    return gcd((ll)y % x, (ll)x);
}

ll modI(ll a, ll m) {
    ll m0 = m, y = 0, x = 1;
    if (m == 1) return 0;
    while (a > 1) {
        ll q = a / m;
        ll t = m;
        m = a % m;
        a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0) x += m0;
    return x;
}

/* **********END OF TEMPLATE*********** */

void solve() {
    string s;
    cin >> s;
    ll ans = 0;
    ll n = s.size();
    for (ll i = 0; i + 3 < n; i++) {
        ans += (s[i] == 'Z' && s[i + 1] == 'O' && s[i + 2] == 'N' &&
                s[i + 3] == 'e');
    }
    cout<<ans<<endl;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << setprecision(12);
    ll tt = 1;
    // cin >> tt;

    for (ll tc = 1; tc <= tt; tc++) {
        // cout << "Case #" << tc << ": ";
        solve();
    }
    return 0;
}