#include <cstdio>

using namespace std;

int main(){
	
	int a,b,c;
	int a1=0,a2=0;
	
	while(scanf("%d,%d,%d",&a,&b,&c) == 3){
		
		if(a*a + b*b == c*c){
			a1++;
		}
		if(a == b){
			a2++;
		}
		
	}
	
	printf("%d\n%d\n",a1,a2);
	
	return 0;
	
}
