#include using namespace std; #define endl '\n' #define lfs cout<= (ll)(n); i--) using ll = long long; using ld = long double; const ll MOD = 1e9+7; //const ll MOD = 998244353; const ll INF = 1e18; using P = pair; template bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;} template bool chmax(T &a,T b){if(a void ans(bool x,T1 y,T2 z){if(x)cout< void debug(vector>&v,ll h,ll w){for(ll i=0;i&v,ll h,ll w){for(ll i=0;i void debug(vector&v,ll n){if(n!=0)cout< vector>vec(ll x, ll y, T w){ vector>v(x,vector(y,w));return v;} ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;} vectordx={1,0,-1,0,1,1,-1,-1}; vectordy={0,1,0,-1,1,-1,1,-1}; template vector make_v(size_t a,T b){return vector(a,b);} template auto make_v(size_t a,Ts... ts){ return vector(a,make_v(ts...)); } ostream &operator<<(ostream &os, pair&p){ return os << p.first << " " << p.second; } ll cnt=0; string operate1(string &s){ ll n=s.size(); string ret; rep(i,0,n){ if(i+5<=n&&s.substr(i,5)=="phnom"){ ret+="penh"; cnt++; i+=4; } else ret+=s[i]; } return ret; } string operate2(string &s){ ll n=s.size(); string ret; bool sw=false; rep(i,0,n){ if(s[i]=='e'){ sw=true; ret+='h'; } else if(s[i]!='h')ret+=s[i]; else sw=true; } cnt+=sw; return ret; } int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll res=0,buf=0; bool judge = true; string s;cin>>s; string now=s; rep(i,0,2){ now=operate1(now); //cout<=1){ cnt+=mx+1; } else{ ll add=0; rep(i,0,now.size()){ if(now[i]=='e')chmax(add,2LL); if(now[i]=='h')chmax(add,1LL); } cnt+=add; } cout<