a= input() print((a.count("t")+a.count("r")+a.count("e")/2)//3)