#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, ans;
  ans = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d%d", &a, &b, &c);
    ans += (a + b + c) / 2;
  }
  printf("%d", ans);
  return 0;
}
