#include<stdio.h> int main() { int s,n,t,a; while(scanf("%d",&n)!=EOF) { s=0,t=0; while(n--) { scanf("%d",&a); s+=a<0?a:a/2; t+=s<0?1:0; } printf("%d\n",t); } }