h = {'t' => 0, 'r' => 0, 'e' => 0} gets.chomp.chars.select{|c| c == 't' || c == 'r' || c == 'e'}.each do |c| h[c] += 1 end h['e'] /= 2 puts h.values.min