#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18;
const long long int mod = 1e9 + 7;
const long long int mod2 = 998244353;
const long long int longinf = 1LL << 60;
const long double pi = acos(-1);
const long double phi = (sqrt(5) + 1) / 2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int sum = 0, prod = 0;
    for (long long int i = 0; i < n; i++) {
      long long int x;
      cin >> x;
      if (x == 0) {
        x++;
        prod++;
      }
      sum += x;
    }
    if (sum == 0) {
      prod++;
    }
    cout << prod << endl;
  }
  return 0;
}
