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