#include<stdio.h>
#include<conio.h>
int main (void ){
int a,b,c,p=0,q=0;
 
    while(scanf("%d,",&a)!=EOF){
            scanf("%d,%d",&b,&c);
if(a+b+c == 12){
	p++;
}
else if(a == b){
	q++;
}

}
printf("%d\n%d\n",p,q);
return 0;

}