s = gets.chomp.chars.map(&:to_sym).tally ans = [s[:t], s[:r], s[:e]/2].min puts ans