#include #include int main(void){ int t=0,r=0,e=0,i,l; char s[1048576]; scanf("%s",s); l = strlen(s); for(i = 0;i < l;i++){ if(s[i] == 't'){t++;} if(s[i] == 'r'){r++;} if(s[i] == 'e'){e++;} } e/=2; if(t <= r && t <= e){printf("%d\n",t);} else if(r <= e){printf("%d\n",r);} else{printf("%d\n",e);} return 0; }