#include <bits/stdc++.h>
using namespace std;
int n, tmp, sum, ans;
int t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) {
    sum = 0, ans = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> tmp;
      if (tmp == 0)
        sum++, ans++;
      else
        sum += tmp;
    }
    if (sum == 0) ans++;
    cout << ans << endl;
  }
  return 0;
}
