#include <bits/stdc++.h>
using namespace std;
vector<map<int, long long int> > g;
vector<int> p;
vector<long long int> dist;
vector<long long int> ins;
vector<long long int> largest;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int zeros = 0;
    int sum = 0;
    while (n--) {
      int in;
      cin >> in;
      if (in == 0) zeros++;
      sum += in;
    }
    int answer = zeros;
    if (sum + zeros == 0) answer++;
    cout << answer << endl;
  }
  return 0;
}
