puts (gets.chomp + gets).scan(/o+/).map{|s| s.length}.max || 0