n_rectangles = 0
n_rhombics   = 0

$<.each_line do |line|
  a, b, c = line.split(",").map(&:to_i)
  if a == b
    n_rhombics += 1
  elsif a**2 + b**2 == c**2
    n_rectangles += 1
  end
end

puts n_rectangles
puts n_rhombics