#include<stdio.h> int main(){ int i,n,a[10000],b,c; while(scanf("%d",&n)!=EOF){ b=0; c=0; for(i=0;i<n;i++){ scanf("%d",&a[i]); if(a[i]>0) a[i]=a[i]/2.0; b=b+a[i]; if(b<0) c++; } printf("%d\n",c); } }