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