#include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv){
	std::vector<int> v(3);
	char tmp;
	int num_rectangle = 0;
	int num_rhombus = 0;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif



#if INPUT_FROM_FILE
	while(ifs >> v[0] >> tmp >> v[1] >> tmp >> v[2]){
#else
	while(std::cin >> v[0] >> tmp >> v[1] >> tmp >> v[2]){
#endif
		
		//std::sort(v.begin(), v.end());

		if(v[0] * v[0] + v[1] * v[1] == v[2] * v[2]){
			num_rectangle++;
		}
		else if(v[0] == v[1]){
			num_rhombus++;
		}
	}
	std::cout << num_rectangle << std::endl;
	std::cout << num_rhombus << std::endl;
	return 0;
}
