#include <bits/stdc++.h>
using namespace std;
int bPow(int v, int u, int mod) {
  if (!u) return 1;
  int res = bPow(v, u / 2, mod);
  res = (res * 1ll * res) % mod;
  if (u & 1) res = (res * 1ll * v) % mod;
  return res;
}
bool fb(long long x) { return 0; }
int bSearch(int l, int r) {
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (fb(m))
      l = m;
    else
      r = m;
  }
  if (fb(l + 1)) l++;
  if (!fb(l)) l = 0;
  return l;
}
void faster() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  if (0) {
    freopen(
        "a"
        ".in",
        "r", stdin);
    freopen(
        "a"
        ".out",
        "w", stdout);
  }
}
vector<int> prime;
bool notprime[1000010];
void resh() {
  int n = 1000010 - 10;
  for (int i = 2; i < n; i++)
    if (!notprime[i]) {
      prime.push_back(i);
      for (int j = i; j < n; j += i) notprime[j] = 1;
    }
}
int is_comp(long long p) {
  for (int i = 0; prime[i] * 1ll * prime[i] <= p; i++) {
    if (p % prime[i] == 0) return prime[i];
  }
  return 0;
}
bool is_prime(long long p) {
  for (int i = 0; prime[i] * 1ll * prime[i] <= p; i++) {
    if (p % prime[i] == 0) return 0;
  }
  return 1;
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (!a) return b;
  return gcd(b % a, a);
}
const int NN = 2e5 + 1;
int main() {
  faster();
  int t;
  cin >> t;
  while (t > 0) {
    int n, a[101], s = 0, k = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      s += a[i];
      if (a[i] == 0) k++;
    }
    if (k > 0) {
      if (s == -k)
        cout << k + 1 << endl;
      else
        cout << k << endl;
    } else {
      if (s == 0)
        cout << 1 << endl;
      else
        cout << 0 << endl;
    }
    t--;
  }
  return 0;
}
