import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while(scan.hasNextInt()) {
int n = scan.nextInt();
int x = 0;//统计不及格的人数
for(int i = 1; i <= n; i++) {
int c = scan.nextInt();//语文
int m = scan.nextInt();//数学
int e = scan.nextInt();//英语
int total = c + m + e;
if(total / 3 < 60) {
x++;
}
}
System.out.println(x);
}
}
}