#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, z, count = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y >> z;
    if (x == 1 && y == 1 && z == 1)
      count++;
    else if (x == 1 && (z == 1 || y == 1))
      count++;
    else if (y == 1 && (z == 1 || x == 1))
      count++;
    else if (z == 1 && (x == 1 || y == 1))
      count++;
  }
  cout << count << endl;
  return 0;
}
