#include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF){ float sum=0; int ans=0; while(n--){ float t; scanf("%f",&t); if(t>0) t=t/2; sum+=t; if(sum<0) ans+=1; } printf("%d\n",ans); }return 0; }