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