// Pratiyush Mishra

#include <bits/stdc++.h>
#define ll long long int
using namespace std;

void mainSolve()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++)
        cin >> v[i];
    bool odd_present = false;
    for (int x : v)
        if (x % 2 == 1)
            odd_present = true;
    int ans = 0;
    if (odd_present)
    {
        for (int x : v)
            if (x % 2 == 0)
                ++ans;
    }
    cout << ans << endl;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    cin >> t;
    while (t--)
    {
        mainSolve();
    }
    return 0;
}