#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, data, hasil = 0, i, cek, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    cek = 0;
    for (j = 0; j < 3; j++) {
      scanf("%d", &data);
      if (data == 1) cek++;
    }
    if (cek >= 2) hasil++;
  }
  printf("%d", hasil);
  return 0;
}
