#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, a;
  cin >> t;
  vector<int> v;
  while (t--) {
    cin >> n;
    v.resize(n);
    int nuly = 0, sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      sum += v[i];
      if (v[i] == 0) {
        nuly++;
        v[i]++;
        sum++;
      }
    }
    if (sum == 0) {
      cout << nuly + 1 << "\n";
    } else {
      cout << nuly << "\n";
    }
  }
}
