#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const int maxn = 110;
const int maxm = 10010;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int count = 0, qcount = 0;
  int flag;
  while (n--) {
    for (int i = 0; i < 3; i++) {
      cin >> flag;
      if (flag == 1) qcount++;
    }
    if (qcount >= 2) count++;
    qcount = 0;
  }
  cout << count << endl;
  return 0;
}
