import std.stdio;
import std.string;
import std.conv;

void main(){

    int ans1=0,ans2=0;
    while(true){
	auto s = readln();
	if(stdin.eof()) break;
	auto n = split(chomp(s),',');
	int x = to!int(n[0]);
	int y = to!int(n[1]);
	int z = to!int(n[2]);
	if(x==0||y==0||z==0)continue;
	if(x*x+y*y==z*z)ans1++;
	else if(x==y&&x+y>z)ans2++;
    }
    writef("%d\n",ans1);
    writef("%d\n",ans2);
}