n,m,c = gets.split(" ").map{|e| e.to_i}
b = gets.split(" ").map{|e| e.to_i}
count = 0

n.times do
  a = gets.split(" ").map{|e| e.to_i}
  sum = c
  m.times do|i|
    sum += a[i]*b[i]
  end

  count += 1 if sum > 0
end

puts count