#include <bits/stdc++.h>
using namespace std;
int a, t[100005];
int main() {
  cin >> a;
  for (int i = 0; i < a; i++) {
    int b = 0, sum = 0;
    cin >> b;
    for (int j = 0; j < b; j++) {
      int temp = 0;
      cin >> temp;
      if (temp == 0) {
        t[i]++;
        temp++;
      }
      sum += temp;
    }
    if (sum == 0) {
      t[i]++;
    }
  }
  for (int i = 0; i < a; i++) {
    cout << t[i] << endl;
  }
}
