#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, z = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int j = 0;
    for (int q = 1; q <= 3; q++) {
      cin >> x;
      if (x == 1) j++;
    }
    if (j >= 2) z++;
  }
  cout << z;
  return 0;
}
