#include <bits/stdc++.h>
using namespace std;
int main(){
freopen ("horsesnum.in","r",stdin);
freopen ("horsesnum.out","w",stdout);
string s,a;
cin>>s;
for (int i=0;i<s.length();i++){
if (('A'<=s[i]&&s[i]<='Z')||('a'<=s[i]&&s[i]<='z')){
char t=tolower(s[i]);
a+=t;
}
}
int ans=0;
for (int i=0;i<a.length();i++){
if (a.substr(i,5)=="horse"){
ans++;
if (a[i+5]=='s')ans++;
}
}
cout<<ans<<endl;
return 0;
}