N,M,C=gets.split(" ").map &:to_i
bs = gets.split(" ").map &:to_i
ans = 0
N.times do |n|
  as = gets.split(" ").map &:to_i
  tmp = C
  M.times do |i| 
    tmp += as[i]*bs[i]
  end
  ans += 1 if tmp > 0
end

puts ans