N, M, C = gets.split.map(&:to_i)
B = gets.split.map(&:to_i)

count = 0
N.times do
  A = gets.split.map(&:to_i)
  sum = 0
  M.times do |m|
    sum += A[m] * B[m]
  end
  count += 1 if sum + C > 0
end

puts count