#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int T, n;
  cin >> T;
  while (T--) {
    cin >> n;
    int count = 0;
    int sum = 0;
    for (int i = 0; i < n; i++) {
      int cur;
      cin >> cur;
      sum += cur;
      if (cur == 0) {
        count++;
        sum++;
      }
    }
    if (sum == 0) count++;
    cout << count << endl;
  }
  return 0;
}
