def right_triangle(a, b, c)
  return a * a + b * b == c * c
end

r, l = 0, 0

while gets
  arr = $_.split(",").map(&:to_i)
  l += 1 if arr[0] == arr[1]
  r += 1 if right_triangle(arr[0], arr[1], arr[2])
end

puts r, l