file = $stdin
files = file.readlines
file.close

rectCount = 0
diaCount = 0
files.each do | w |
	tmp = w.split(",")
	if (tmp[0].to_i ** 2 + tmp[1].to_i ** 2) == (tmp[2].to_i ** 2) then
		rectCount += 1
	elsif tmp[0].to_i == tmp[1].to_i then
		diaCount += 1
	end
end
puts rectCount
puts diaCount