#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][3];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> a[i][j];
    }
  }
  int x = 0;
  for (int i = 0; i < n; i++) {
    if (a[i][0] == 1 && a[i][1] == 1 && a[i][2] == 1) {
      x++;
    } else if (a[i][0] == 1 && a[i][1] == 1 && a[i][2] == 0) {
      x++;
    } else if (a[i][0] == 1 && a[i][1] == 0 && a[i][2] == 1) {
      x++;
    } else if (a[i][0] == 0 && a[i][1] == 1 && a[i][2] == 1) {
      x++;
    } else {
    }
  }
  cout << x << endl;
  return 0;
}
