#include <bits/stdc++.h>
using namespace std;
bool cmp(const string &a, const string &b) { return a.size() < b.size(); };
string ToString(long long n) {
  string ret = "";
  while (n > 0) {
    ret += (n % 10) + '0', n /= 10;
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
const int N = 2e5 + 5, mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, t;
  cin >> t;
  while (t--) {
    cin >> n;
    int arr[n], zero = 0, sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      if (!arr[i]) zero++, arr[i] = 1;
      sum += arr[i];
    }
    if (!sum)
      cout << zero + 1 << "\n";
    else
      cout << zero << "\n";
  }
  return 0;
}
