S = gets.chomp counter = S.chars.tally counter.default = 0 puts [counter['t'], counter['r'], counter['e'] / 2].min