#include <stdio.h>

int main(void)
{
	int alpha=1;
	int beta=0; /*Óa,Ób,Îpüc*/
	int charley=0;
	int rect = 0;/*·û`Ì*/
	int rhom = 0;/*Ðµ`Ì*/


	while(alpha != 0){
	scanf("%d",&alpha);
	scanf(",%d",&beta);
	scanf(",%d",&charley);

	if( charley*charley == alpha*alpha + beta*beta && alpha != 0 )
		rect++;

	if( alpha == beta && alpha != 0 )
		rhom++;

	}


	printf("%d\n",rect);
	printf("%d\n",rhom);

	return 0;
}