#include <iostream>
#include <cstdio>
#include <string>

using namespace std;

int main()
{
	int rectangle = 0;
	int rhombus   = 0;

	string line;
	while(getline(cin, line))
	{
		int a, b, c;
		sscanf(line.c_str(), "%d,%d,%d", &a, &b, &c);

		if(a * a + b * b == c * c)
			rectangle++;
		if(a == b)
			rhombus++;
	}

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

	return 0;
}