#include #include #include #include #include using namespace std; typedef long long ll; int main() { ll t, n, f, answer; cin >> t; for (ll i = 0; i < t; i++) { cin >> n; answer = 0; for (ll k = 0; k < n; k++) { cin >> f; if (f==1) { answer++; } } } cout << answer << endl; return 0; }