#encoding:utf-8 No.0032 2014.10.6
data = []
while true
  input = gets.chomp.split(/,/)
  if input == []
    break
  end
  data.push input.map{|item| item = item.to_i}
end

rectangle = 0
diamond = 0

data.length.times do |i|
  if data[i][0]**2 + data[i][1]**2 == data[i][2]**2
    rectangle += 1
  elsif data[i][0] == data[i][1]
    diamond += 1
  end
end

puts rectangle
puts diamond