#include <bits/stdc++.h>
using namespace std;
void solve() {
  int t;
  cin >> t;
  int n = 0;
  while (t--) {
    int a[3];
    for (int i = 0; i < 3; i++) {
      cin >> a[i];
    }
    int cnt = 0;
    for (int i = 0; i < 3; i++)
      if (a[i] == 1) cnt++;
    if (cnt >= 2) n++;
  }
  cout << n << endl;
}
int main() {
  ios::sync_with_stdio(false);
  solve();
}
