s=input() t=s.count("t") r=s.count("r") e=s.count("e") if t<1 or r<1 or e<2: print(0) else: if t