c = gets.chomp + gets.chomp puts c.split(/x+/).map(&:size).max