#include <stdio.h>

int main() {
	int n = 0, i = 0, c = 0, m = 0, e = 0, average = 0, count = 0;
	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d%d%d", &c, &m, &e);
		average = (c + m + e) / 3;
		if (average < 60)
			count++;
	}
	printf("%d", count);

	return 0;
}