#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, count = 0, p = 0, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c;
    if (a == 1) {
      p++;
    }
    if (b == 1) {
      p++;
    }
    if (c == 1) {
      p++;
    }
    if (p >= 2) {
      count++;
    }
    p = 0;
  }
  cout << count << endl;
  return 0;
}
