#include <bits/stdc++.h>
using namespace std;
char arr;
int main() {
  int n, x = 0, z = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    for (int k = 0; k < 3; ++k) {
      cin >> arr;
      if (arr == '1') ++z;
    }
    cout << endl;
    if (z >= 2) ++x;
    z = 0;
  }
  cout << x << endl;
}
