#include <bits/stdc++.h>
using namespace std;
const int maxn = 2E5 + 5;
const int maxm = 1E5 + 5;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long mod = 1E9 + 7;
const double eps = 1E-6;
const double PI = acos(-1.0);
vector<int> a;
void solve() {
  int n;
  cin >> n;
  a.resize(n);
  int sum = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (!a[i]) sum++, cnt++;
    sum += a[i];
  }
  if (sum == 0) cnt++;
  cout << cnt << "\n";
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int T = 1;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
