#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[3];
  int s = 0;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> a[j];
      if (a[j] == 1) count++;
    }
    if (count >= 2) s++;
    count = 0;
  }
  cout << s << endl;
}
