#include <stdio.h>
#include <math.h>
#include <string.h>
int main(){
int i,n,dig;
double point;
double a[99999];
while(scanf("%d",&n)!=EOF)
{
point=0;
dig = 0;
for(i=0;i<n;++i)
{
scanf("%lf",&a[i]);
if(a[i]>0)
point = point + (a[i]/2);
else
point += a[i];
if(point<0)
dig++;
}
printf("%d\n",dig);
}
}