def rect?(arr)
   arr[2] ** 2 == arr[0] ** 2 + arr[1] ** 2
end
def loze?(arr)
   arr[0] == arr[1]
end
#main
arr = Array.new
r = 0
l = 0
while line = gets
   arr << line
end
arr.each do |i|
   a = i.split(",")
   a.map!{|j| j.to_i}
   if rect?(a)
      r += 1
   elsif loze?(a)
      l += 1
   end
end
puts r
puts l