#include <bits/stdc++.h>   using namespace std;   int main() {     char ch;     int n, cnt = 0;     long long x, a;     scanf( %d%I64d , &n, &x);     for (int i = 0; i < n; i++) {       while (isspace(ch = getchar()))         ;       scanf( %I64d , &a);       if (ch ==  + )         x += a;       else {         if (x < a)           cnt++;         else           x -= a;       }     }     cout << x <<     << cnt << endl;     return 0;   }   