#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, *a, psum = 0, cnt = 0;
    cin >> n;
    a = new int[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (!a[i]) a[i]++, cnt++;
      psum += a[i];
    }
    if (psum)
      cout << cnt << endl;
    else
      cout << cnt + 1 << endl;
  }
  return 0;
}
