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

int main() {
	
	int edge1, edge2, diag;
	char a, b;
	int Rcount = 0, Hcount = 0;
	while(cin >> edge1 >> a >> edge2 >> b >> diag){
		if(pow(edge1, 2.0) + pow(edge2, 2.0) == pow(diag, 2.0))
			Rcount++;
		
		if(edge1 == edge2)
			Hcount++;
	}
	
	cout << Rcount << endl;
	cout << Hcount << endl;
	return 0;
}