s = gets.chars a = %w{t r e}.map{|c|s.count c} a[2] /= 2 p a.min