#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int x[n], a = 0, ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> x[i];
      if (x[i] == 0) x[i] = 1, ans++;
      a += x[i];
    }
    if (a == 0) ans++;
    cout << ans << endl;
  }
}
