#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, _sum, zeros, a, cnt;
  cin >> t;
  while (t--) {
    cin >> n;
    zeros = _sum = cnt = 0;
    while (n--) {
      cin >> a;
      if (a == 0) ++zeros;
      _sum += a;
    }
    if (zeros > 0) {
      _sum += zeros;
      cnt += zeros;
    }
    if (_sum == 0) {
      ++_sum;
      ++cnt;
    }
    cout << cnt << endl;
  }
  return 0;
}
