#include <bits/stdc++.h>
const int maxn = 1e5 + 5;
const int maxm = 1e5 + 10;
const int mod = 1e9 + 7;
const long long int INF = 1e18 + 100;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-6;
using namespace std;
int n;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int ans = 0, res = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      int a;
      scanf("%d", &a);
      if (a == 0)
        ans++, res += 1;
      else
        res += a;
    }
    if (res == 0) ans++;
    printf("%d\n", ans);
  }
}
