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