#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<char> a(12);
  for ( int k = 0; k < 12; k++){
    cin >> a.at(k);
  }
  int p = 0;
  for ( int i = 0; i < 9; i++){
  if (a.at(i) == 'Z' && a.at(i + 1) == 'O'){
    if (a.at(i + 2) == 'N' && a.at(i + 3) == 'e'){
      p++;
    }
  }
  }
    cout << p << endl;
}
  
#include <bits/stdc++.h>
#define fi first
#define se second
#define is_in(x,l,r) ((l) <= (x) && (x) < (r))
#define sz(x) (int)(x).size()
#define rng(a) a.begin(),a.end()
#define rngr(a) a.rbegin(),a.rend()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define pb push_back
#define eb emplace_back
using namespace std;
const long long INF = 1LL<<60; // 仮想的な無限大の値;
const int inf = 1<<30;
const double pi = acos(-1);
using ll = long long;
using P  = pair<int, int>;
#define vi vector<int>
#define vvi vector<vi>
#define vll vector<ll>
#define vs vector<string>
#define vp vector<P>
#define vvp vector<vp>
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main()
{
    int n = 0;//"Yes";"No"
    string s;
    cin >> s;
    rep(i, sz(s))if(i+4 <= sz(s)){
        string t = s.substr(i, 4);
        if(t == "ZONe") ++n;
    }
    cout << n << endl;
    return 0;
}