#include<bits/stdc++.h>
using namespace std;
#define N 60005
typedef long long ll;
int g,ans;
char in[N],zm[N];
int read(){
int w=0,f=1;
char c=getchar();
while (c>'9'||c<'0'){
if (c=='-') f=-1;
c=getchar();
}
while (c>='0'&&c<='9'){
w=(w<<3)+(w<<1)+(c^48);
c=getchar();
}
return w*f;
}
int main(){
freopen("horsesnum.in","r",stdin);
freopen("horsesnum.out","w",stdout);
scanf("%s",in);
int l=strlen(in);
for (int i=0;i<l;i++){
if (in[i]>='a'&&in[i]<='z') zm[++g]=in[i];
else if (in[i]>='A'&&in[i]<='Z') zm[++g]=in[i]-'A'+'a';
}
for (int i=1;i<=g-4;i++){
if (zm[i]=='h'&&zm[i+1]=='o'&&zm[i+2]=='r'&&zm[i+3]=='s'&&zm[i+4]=='e'){
if (zm[i+5]=='s') ans+=2;
else ans++;
}
}
printf("%d\n",ans);
return 0;
}