c1,c2 = 0,0
while arr = gets
  a,b,c = arr.chomp.split(",").map(&:to_i)
  unless (c**2 == a**2 + b**2) && (a == b)
    c1 = c1 + 1 if c**2 == a**2 + b**2
    c2 = c2 + 1 if a == b
  end
end
puts c1; puts c2