#include<iostream>
#include<cmath>
using namespace std;

int main(){
	double side1, side2, diagonal, rectangle, rhombus;
	char x, y;
	while(cin >> side1 >> x >> side2 >> y >> diagonal){
		if(pow(side1, 2.0) + pow(side2, 2.0) == pow(diagonal, 2.0) && side1 != side2){
			rectangle++;
		}
		else if(pow(side1, 2.0) + pow(side2, 2.0) != pow(diagonal, 2.0) && side1 == side2){
			rhombus++;
		}
	}

	cout << rectangle << endl << rhombus << endl;
}