#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n;
void work() {
  n = read();
  int s1 = 0, s2 = 0, x;
  for (int i = 1; i <= n; ++i) {
    x = read();
    s1 += x;
    if (x == 0) ++s2;
  }
  if (s1 + s2 == 0)
    printf("%d\n", s2 + 1);
  else
    printf("%d\n", s2);
}
int main() {
  int T = read();
  while (T--) work();
  return 0;
}
