S=gets t=S.count("t") r=S.count("r") e=(S.count("e")/2).to_i puts [t,r,e].min