puts (gets.chomp + gets.chomp).split(//).chunk{|i|i == "o"}.map{|i, j| if i then j.size else 0 end}.max