require 'matrix'

max_row, _, const = STDIN.gets.split.map(&:to_i)
vec_B = Vector.elements(STDIN.gets.split.map(&:to_i), copy=false)

cnt = 0
max_row.times do |_|
  vec_A = Vector.elements(STDIN.gets.split.map(&:to_i), copy=false)
  cnt += 1 if vec_A.dot(vec_B) + const > 0
end

STDOUT.puts cnt