
def check(board_data)
  if board_data[0]**2 + board_data[1]**2 == board_data[2]**2
    return 1
  elsif board_data[0] == board_data[1]
    return 2
  end
  return 0
end

count_rect = 0
count_loze = 0
while input = gets do
  input_data = (input.chomp).split(",")
  board_data = []
  input_data.each do |datum|
    board_data << datum.to_i
  end

  flag = check(board_data)
  if flag == 1
    count_rect += 1
  elsif flag == 2
    count_loze += 1
  end
end

puts count_rect
puts count_loze