#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 0) {
        a[i] = 1;
        ans++;
      }
    }
    int sum = 0;
    for (int i = 0; i < n; i++) sum += a[i];
    if (sum == 0) ans++;
    cout << ans << endl;
  }
  return 0;
}
