def calc
  rectangle = 0
  rhombus = 0
  while gets
    x, y, z = $_.split(',').map(&:to_i)
    rhombus += 1 if x == y
    rectangle += 1 if x ** 2 + y ** 2 == z ** 2
  end
  puts rectangle
  puts rhombus
end

calc