#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i, j;
  cin >> n;
  int pout = 0;
  while (n--) {
    int count = 0, count1 = 0, count2 = 0;
    int a[3], b[3], c[3];
    for (int i = 0; i < (int)(3); ++i) {
      cin >> a[i];
    }
    for (int i = 0; i < (int)(3); ++i) {
      if (a[i] == 1) {
        count++;
      }
    }
    if (count >= 2) {
      pout++;
    }
  }
  cout << pout << endl;
}
