num_diamond   = 0
num_rectangle = 0
while line = $stdin.gets
	data = line.chomp.split(/,/).map{|n| n.to_i }
	a = data[ 0 ]
	b = data[ 1 ]
	c = data[ 2 ]
	num_diamond   += 1 if a == b
	num_rectangle += 1 if a * a + b * b == c * c
end
puts num_rectangle
puts num_diamond
