#include <iostream>
#include <cstdio>

int main()
{
	int rectangles = 0;
	int lozenges = 0;
	unsigned int side1, side2, diagonal;
	while (std::scanf("%d,%d,%d", &side1, &side2, &diagonal) == 3) {
		if (side1 + side2 > diagonal) {
			if (side1 * side1 + side2 * side2 == diagonal * diagonal) {
				++rectangles;
			}
			if (side1 == side2) {
				++lozenges;
			}
		}
	}

	std::cout << rectangles << '\n' << lozenges << '\n';

	return 0;
}