s = gets puts [s.count("t"), s.count("r"), s.count("e") / 2].min