#include <bits/stdc++.h> using namespace std; int main(){ int t; while(cin>>t){ int date=0; double num,sum=0; while(t--){ cin>>num; if(num>0){ sum+=(num/2); } else sum+=num; if(sum<0)date++; } cout<<date<<endl; } }