#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, a, sum = 0, c = 0;
    cin >> n;
    while (n--) {
      cin >> a;
      if (!a) {
        c++;
        a++;
      }
      sum += a;
    }
    if (!sum) c++;
    cout << c << endl;
  }
}
