// 举个反例 谢谢
#include <iostream> #include <cmath> using namespace std ; int main() { int n, Hp = 1, Hp2 = 1, x ; cin >> n ; while (n--) { cin >> x ; if ( x < 0 && Hp2 + x <= 0) { Hp += abs(x); } else { Hp2 += x ; } } cout << Hp ; }