import std.stdio, std.algorithm, std.string, std.conv, std.array;

void main()
{
    auto input = stdin.byLine().map!(line => line.split(",").map!(to!int).array).array;
    input.count!q{ a[0] ^^ 2 + a[1] ^^ 2 == a[2] ^^ 2}.writeln;
    input.count!q{ a[0] ==  a[1]}.writeln;
}