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

int main()
{
	int NumOfC = 0;
	int NumOfH = 0;

	char c;

	int l1, l2, l3;

	while(std::cin>> l1 >> c >> l2 >> c >> l3)
	{
		if(l1*l1+l2*l2 == l3*l3)
		{
			++NumOfC;
		}

		if(l1 == l2)
		{
			++NumOfH;
		}
	}

	std::cout << NumOfC << '\n' << NumOfH << '\n';
}