#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int64_t sum = 0, count_zero = 0;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      sum += x;
      if (x == 0) count_zero++;
    }
    if (sum != 0 && count_zero == 0)
      cout << "0" << endl;
    else if (-sum == count_zero)
      cout << count_zero + 1 << endl;
    else
      cout << count_zero << endl;
  }
}
