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