#include <bits/stdc++.h>
using namespace std;
void solve() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int sum = 0;
    int zero = 0;
    for (int i = 0, x; i < n; i++) {
      cin >> x;
      if (x == 0) zero++;
      sum += x;
    }
    int need = zero;
    sum += zero;
    if (sum == 0) {
      need++;
    }
    cout << need << endl;
  }
}
int main() {
  solve();
  getchar();
  getchar();
}
