#include<stdio.h>
int main() {
int n, count = 0;
scanf("%d", &n);
int a[n], b[n], c[n];
for (int i = 0; i < n; i++) {
scanf("%d %d %d\n", &a[i], &b[i], &c[i]);
if ((a[i] + b[i] + c[i]) / 3 < 60)
count++;
}
printf("%d", count);
return 0;
}
int main() {
int n, count = 0;
scanf("%d", &n);
int a[n], b[n], c[n];
for (int i = 0; i < n; i++) {
scanf("%d %d %d\n", &a[i], &b[i], &c[i]);
if ((a[i] + b[i] + c[i]) / 3 < 60)
count++;
}
printf("%d", count);
return 0;
}