#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p[n], q[n], r[n];
  int answer = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> p[i] >> q[i] >> r[i];
    if (p[i] == 1) {
      count++;
    }
    if (q[i] == 1) {
      count++;
    }
    if (r[i] == 1) {
      count++;
    }
    if (count >= 2) {
      answer++;
    }
    count = 0;
  }
  cout << answer << "\n";
  return 0;
}
