count = 0
n = int(input("Enter the size: "))
list = []

print("Enter the elements:")  # Enter 0's and 1's
for i in range(0, n):
    num = int(input())
    list.append(num)

for i in range(0, n):
    if (list[i] == 1 and list[i+1] == 1:
        count = count + 1
    else:
    	if(list[i] == 0 and list[i+1]==0):
        count = 0

print("Max number of consecutive 1's is", count+1)