#include <stdio.h>

int main() {
    
    int peopleNum = 0;
    scanf("%d",&peopleNum);

    int Chinese, math, English;
    int result = 0;
    for (int i = 0; i < peopleNum; i++)
    {
        scanf("%d %d %d",&Chinese,&math,&English);
        int averageScores = (Chinese + math + English) / 3;
        if (averageScores < 60)
        {
            result++;
        }
    }

    printf("%d",result);
    return 0;
}