#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q;
  cin >> q;
  for (long long l = 0; l < q; ++l) {
    int n, k = 0, S = 0;
    cin >> n;
    int r[n];
    for (int i = 0; i < n; ++i) {
      cin >> r[i];
      if (r[i] == 0) {
        r[i]++;
        ++k;
      };
      S += r[i];
    }
    if (S == 0) ++k;
    cout << k << endl;
  }
  return 0;
}
