require 'matrix'

N, M, C = gets.split.map(&:to_i)
cs = Vector[*Array.new(N, C)]
bs = Vector[*gets.split.map(&:to_i)]
as_list = []
N.times do
  as_list.push gets.split.map(&:to_i)
end

A = Matrix[*as_list]
evals = A * bs + cs
ans = evals.to_a.select{|e| e > 0}.length

print("#{ans}\n")
