#include <cstdio>
int main(){
	int a,b,c;
	int r1=0, r2=0;
	while(scanf("%d,%d,%d", &a, &b, &c)!=EOF){
		if(a*a+b*b==c*c)
			r1++;
		else if(a==b)
			r2++;
	}
	printf("%d\n%d\n", r1, r2);
	return 0;
}
