#include <cstdio>
using namespace std;

int a, b, c, r = 0, d = 0;

int main(){
	while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
		if (a*a + b*b == c*c) {
			r++;
		}
		if (a == b) {
			d++;
		}
	}
	printf("%d\n%d\n", r, d);

	return 0;
}