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