#include <stdio.h>

int main() 
{
    int a,b,c,count=0,n;
    scanf("%d",&n);
    while(n)
    {
        scanf("%d %d %d",&a,&b,&c);
        if((a+b+c)/3<60) count++;
        n--;
    }
    printf("%d",count);
    return 0;
}