var
i:byte;
a,b,c,n:integer;
begin
while not eof do begin
n:=0;
for i:=1 to 5 do begin
readln(a,b,c);
if (a>c) and (a>b) then if (a*a)=(b*b)+(c*c) then n:=n+1;
if (b>c) and (b>a) then if (b*b)=(a*a)+(c*c) then n:=n+1;
if (c>a) and (c>b) then if (c*c)=(b*b)+(a*a) then n:=n+1;
end;
writeln(n);
end;
readln;
end.