#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int count, total = 0, n;
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    count = 0;
    getline(cin, s);
    if (s[0] == 48) count++;
    if (s[2] == 48) count++;
    if (s[4] == 48) count++;
    if (count <= 1) total++;
  }
  cout << total;
}
