#include using namespace std; #define int long long signed main(){ string s; cin >> s; int n = s.size(); s +="USHITAPUNICHIAKUN"; int zone; int ans = 0; int e = 0; for(int i = 0;i < n;i++){ if(s[i] == 'p' && s[i+1] == 'h' && s[i+2] == 'n'){ zone = 0; for(int j = i+3;j < n;j += 2){ if(s[j] == 'o' && s[j+1] == 'm'){ zone++; } } ans = max(ans, zone*2+1); } if(s[i] == 'e' && s[i] == 'h') ans = max(ans, 1ll); if(s[i] == 'p' && s[i+1] == 'e' && s[i+2] == 'n' && s[i+3] == 'h'){ zone = 0; for(int j = i+4;j < n;j += 2){ if(s[j] == 'o' && s[j+1] == 'm'){ zone++; } } ans = max(ans, zone*2+2); } } cout << ans << endl; return 0; }