#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> v;
    int zero = 0, sum = 0;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      v.push_back(x);
      if (x == 0) {
        zero++;
      }
      sum += x;
    }
    sum += zero;
    int ans = 0;
    ans += zero;
    if (sum == 0) {
      ans++;
    }
    cout << ans << endl;
    v.clear();
  }
  return 0;
}
