#include <bits/stdc++.h>
int main() {
  int n, i, j, g, k, a[3];
  while (~scanf("%d", &n)) {
    for (i = 0, k = 0; i < n; i++) {
      for (j = 0, g = 0; j < 3; j++) {
        scanf("%d", &a[j]);
        if (a[j] == 1) {
          g++;
        }
      }
      if (g >= 2) {
        k++;
      }
    }
    printf("%d\n", k);
  }
  return 0;
}
