#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, o = 0, s, q = 0, e = 0;
  cin >> n;
  for (int j = 0; j < n; j++) {
    q = 0;
    cin >> e;
    cin >> s;
    e += s;
    if (e == 2) {
      o++;
      q = 1;
    }
    cin >> s;
    e += s;
    if ((e == 2) && (q == 0)) o++;
  }
  cout << o;
}
