#include <bits/stdc++.h>
using ll = long long;
using namespace std;
using pii = pair<int, int>;
using namespace std;
const int N = 2e5 + 5;
ll mod = 998244353;
int main() {
  ll tcc = 1;
  cin >> tcc;
  while (tcc--) {
    ll n, s = 0, c = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      ll a;
      cin >> a;
      if (a == 0)
        s += 1, c++;
      else
        s += a;
    }
    if (s == 0) c++;
    cout << c << "\n";
  }
  return 0;
}
