#include <stdio.h>
#include<iostream.h>

void main() {
    int arr[20], n, temp = 0, con = 0;

    printf("Enter the number of elements:\n");
    scanf("%d", &n);

    printf("Enter the array elements (0 or 1):\n");
    for (int i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    printf("\n");
    arr[n] = 0;  

    for (int i = 0; i < n; i++) {
        if (arr[i] == 1) {
            temp++;

            if (arr[i + 1] == 0) { 
                if (con < temp) {
                    con = temp;
                }
                temp = 0;
            }
        }
    }

    printf("num of 1's are %d \n", con);
}