data = Array.new
while line = STDIN.gets
  a = line.split(/,/)
  for i in 0.. a.length-1
    a[i] = a[i].to_i
  end
  data.push(a)
end
out = [0,0]
for i in 0..data.length-1
  if data[i][0] == 0 || data[i][1] == 0 || data[i][2] == 0
    continue
  end
  if data[i][0]*data[i][0]+data[i][1]*data[i][1] == data[i][2]*data[i][2]
    out[0] += 1
  elsif data[i][0] == data[i][1]
    out[1] += 1
  end
end
puts out*"\n"