#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using P = pair<int, int>;
using P3 = pair<int, P>;
using PP = pair<P, P>;
constexpr ll MOD = ll(1e9 + 7);
constexpr int IINF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
constexpr double EPS = 1e-8;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
bool solve() {
  int n, sum = 0, zr = 0;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
    if (a[i] == 0) zr++;
  }
  int ans = zr;
  sum += zr;
  if (sum == 0) ans++;
  cout << ans << "\n";
  return true;
}
int main() {
  int t;
  cin >> t;
  for (; t > 0; t--) solve();
  return 0;
}
