#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a = 0, b = 0, res = 0;
    int n;
    cin >> n;
    int x[n];
    for (int i = 0; i < n; i++) {
      cin >> x[i];
      if (x[i] == 0) b++;
      a += x[i];
    }
    if (b > 0) {
      res += b;
      a += b;
    }
    if (a == 0) res++;
    cout << res << "\n";
  }
  return 0;
}
