t = 0 r = 0 e = 0 gets.chars.each do |s| case s when "t" then t += 1 when "r" then r += 1 when "e" then e += 1 end end ans = [t,r,e/2].min puts ans