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