n, m, c = io.read("*n", "*n", "*n")
b = {}
for i = 1, m do
  b[i] = io.read("*n")
end
r = 0
for i = 1, n do
  z = c
  for i = 1, m do
    a = io.read("*n")
    z = z + a * b[i]
  end
  if 0 < z then r = r + 1 end
end
print(r)
