#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, c = 0, sum = 0;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
      if (!a[i]) c++;
    }
    if (sum + c != 0)
      cout << c << endl;
    else
      cout << c + 1 << endl;
  }
}
