#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, counter = 0;
  cin >> n;
  int a1[n][3];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 3; j++) cin >> a1[i][j];
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < 3; k++) {
      if (a1[i][k] == 1) count++;
    }
    if (count >= 2) {
      counter++;
      count = 0;
    } else
      count = 0;
  }
  cout << counter;
  return 0;
}
