input = gets.chomp tree_count = [] tree_count[0] = input.count("t") tree_count[1] = input.count("r") tree_count[2] = input.count("e") / 2 puts tree_count.min