#include <bits/stdc++.h>
using namespace std;
long long t, i, n, s, k, a, j;
int main() {
  cin >> t;
  for (i = 0; i < t; ++i) {
    cin >> n;
    for (j = 0; j < n; ++j) {
      cin >> a;
      s += a;
      if (a == 0) ++k;
    }
    if (s + k == 0) ++k;
    cout << k << endl;
    k = 0;
    s = 0;
  }
  return 0;
}
