In the old times, when dragons ruled the land, air temperature never fell below zero degrees. But after dragons left, nice and warm times went with them.
We say that day is a winter day when average temperature for that day is below zero. We say that
There are some people that annoy everyone by rambling on about some winter that is coming. So a law
had to be made, stating that you are allowed to say that winter is coming at most
Knowing expected temperatures for some time period, find out the maximum number of days during which it is allowed to say that winter is coming.
Input Specification
The first line of input contains the integer
Output Specification
The first and only line of output should contain the maximum number of days during which it is allowed to announce the winter is coming.
Scoring
In test cases worth
Sample Input 1
8
1 -1 4 3 8 -2 3 -3
Sample Output 1
6
Explanation for Sample Output 1
There are three winter periods of length one. In order to obtain the
requested maximum, best thing to do is to choose the second one to apply the
Day | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---|---|---|---|---|---|---|---|---|
Temperature | 1 | -1 | 4 | 3 | 8 | -2 | 3 | -3 |
Winter | no | yes | no | no | no | yes | no | yes |
Winter is coming | yes | no | yes | yes | yes | yes | yes | no |
Sample Input 2
15
1 2 -1 2 3 4 5 6 1 4 8 3 -1 -2 1
Sample Output 2
8
Comments