#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
void solve() {
  int n;
  cin >> n;
  vector<int> nums(n);
  for (int i = 0; i < n; ++i) cin >> nums[i];
  int s = 0;
  for (int i = 0; i < n; ++i) s += nums[i];
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (nums[i] == 0) {
      s++;
      ans++;
    }
  }
  if (s == 0) {
    ans++;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
