Under construction

Still being built. Things may change

Longest Streak

Time limit1sMemory limit1024 MB

Summary
Given daily solve counts for N days, the task is to find the longest run of consecutive days with at least one solved problem.
Level

Easy2 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

The solved.ac site has a metric that shows how many consecutive days a user solved problems. This metric is called a streak. If you solved at least 11 problem every day for a total of xx days, the streak is xx days.

The longest streak is the largest streak achieved within a period of NN days in total. Given the number of problems solved on each of the NN days, find the longest streak.

Input

The first line contains NN. (1≤N≤1 000)(1 \le N \le 1\,000)

The second line contains s_1s\_1, s_2s\_2, ⋯\cdots, s_Ns\_N separated by spaces. s_is\_i is the number of problems solved on day ii. (0≤s_i≤100)(0 \le s\_i \le 100)

Output

Print the longest streak.

Examples4

  1. Example 1

    Input
    4
    1 4 0 1
    
    Expected output
    2
    
  2. Example 2

    Input
    5
    1 6 3 8 3
    
    Expected output
    5
    
  3. Example 3

    Input
    3
    0 100 0
    
    Expected output
    1
    
  4. Example 4

    Input
    1
    0
    
    Expected output
    0