#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<stdlib.h>
using namespace std;
const int maxn = 1e5+10;
const int inf = 0x3f3f3f3f;
int n;
double a;
int main(){
while(scanf("%d",&n)!=EOF){
double ans=0;
int t=0;
for(int i=1;i<=n;i++){
scanf("%lf",&a);
if(a>0)
ans+=a/2;
else{
ans+=a;
}
if(ans<0)t++;
// printf("%f\n",ans);
}
printf("%d\n",t);
}
}