#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, s = 0, c = 0, i, k;
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> k;
      if (k == 0) c++, k++;
      s = s + k;
    }
    if (s == 0) c++;
    cout << c << endl;
  }
}
