#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n, sum = 0, tum = 0, x, result = 0;
    cin >> n;
    while (n--) {
      cin >> x;
      (x == 0) ? tum++ : sum += x;
    }
    result = tum;
    sum += tum;
    cout << ((sum != 0) ? result : result + 1) << endl;
  }
  return 0;
}
