c = gets.chomp t,r,e = c.count("t"), c.count("r"),c.count("e")/2 p [t,r,e].min