int main(void){
	int hen1,hen2,taikaku,tyouhou=0,hisigata=0;
	
	while(scanf("%d,%d,%d",&hen1,&hen2,&taikaku) != EOF){
		if(sqrt(hen1*hen1 + hen2*hen2) == taikaku && hen1 == hen2){
			// 正方形
		}else if(sqrt(hen1*hen1 + hen2*hen2) == taikaku){
			// 長方形
			tyouhou++;
		}else if(hen1 == hen2){
			hisigata++;
		}
	}
	printf("%d\n%d\n",tyouhou,hisigata);
}