S = input() t=0 r=0 e=0 for i in S: if i =="t": t+=1 if i =="r": r+=1 if i =="e": e+=1 e= int(e/2) array = [t,r,e] array.sort() print(array[0])