class Solution(object):
    def max_consecutive_ones(self, numbers):
        if not numbers:
            return 0

        longest, count = 0, 0
        for num in numbers:
            if num > 0:
                count += 1
                longest = max(longest, count)
            else:
                count = 0
        
        return longest

solution = Solution()
numbers = [1, 1, 0, 1, 1, 1]
print(solution.max_consecutive_ones(numbers))