puts (gets.chomp + gets.chomp).split('x').map(&:length).max || 0