#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, p, v, t, n, count;
  count = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> p >> v >> t;
    if ((p & v == 1) || (p & t == 1) || (t & v == 1)) {
      count++;
    }
  }
  cout << count;
  return 0;
}
