l ={"t":0,"r":0,"e":0} for i in input(): l[i] += 1 l["e"] = l["e"]//2 print(min(l.values()))