import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	int cnt1, cnt2;
	foreach (line; stdin.byLine) {
		auto e = line.split(",").map!(to!int);
		if (e[0] == e[1]) cnt2++;
		else if (e[0]^^2 + e[1]^^2 == e[2]^^2) cnt1++;
	}
	cnt1.writeln;
	cnt2.writeln;
}