#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  int y = 0;
  int r = 0;
  int a[3010];
  cin >> x;
  for (int i = 0; i < (3 * x); i++) {
    cin >> a[i];
  }
  for (int q = 0; q < (3 * x); q = q + 3) {
    y = 0;
    if (a[q] == 1) {
      y++;
    }
    if (a[q + 1] == 1) {
      y++;
    }
    if (a[q + 2] == 1) {
      y++;
    }
    if (y >= 2) {
      r++;
    }
  }
  cout << r << endl;
}
