class Plastic
  def initialize
    rect_num = 0
    loze_num = 0

    while input = $stdin.gets do
      @a,@b,@c = input.chomp.split(',').map(&:to_i)
      rect_num += 1 if check_rect
      loze_num += 1 if check_loze
    end

    puts rect_num
    puts loze_num
  end

  def check_rect
    @a*@a + @b*@b == @c*@c
  end

  def check_loze
    @a == @b
  end
end

p = Plastic.new