#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  if (a == b) return a;
  return gcd(b, a % b);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int ar, sum = 0, in = 0;
    cin >> ar;
    int arr[ar];
    for (int i = 0; i < ar; i++) {
      cin >> arr[i];
      if (arr[i] == 0) {
        arr[i]++;
        in++;
      }
      sum += arr[i];
    }
    if (sum == 0)
      cout << in + 1 << endl;
    else
      cout << in << endl;
  }
  return 0;
}
