n,m,c = $stdin.gets.split.map(&:to_i)
b = $stdin.gets.split.map(&:to_i)
result = 0
n.times do |i|
  sum = 0
  a = $stdin.gets.split.map(&:to_i)
  m.times do |j|
    sum += a[j]*b[j]
  end
  if sum + c > 0
    result += 1
  end
end
puts result