n_rectangles = 0
n_rhombics   = 0

$<.each_line do |line|
  a, b, c = line.split(",").map(&:to_i)

  if a == b && ((a**2 + b**2) ** 0.5).to_i == c
    next
  end

  if a == b
    n_rhombics += 1
    next
  end

  if ((a**2 + b**2) ** 0.5).to_i == c
    n_rectangles += 1
    next
  end
end

puts n_rectangles
puts n_rhombics