#include <bits/stdc++.h>
using namespace std;
long long int i, j, n, t, x, y, a[10000], b[11], c, d, e, f[100000], g, k, mx,
    m, z;
string s[10000], p[10000];
char v[100000], fa[10];
int main() {
  cin >> t;
  while (t--) {
    c = d = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> x;
      if (x == 0) {
        c++;
      }
      d += x;
    }
    if (c + d) {
      cout << c << endl;
    } else {
      cout << c + 1 << endl;
    }
  }
  return 0;
}
