n,m,c = gets.chomp.split(' ').map(&:to_i)
b = gets.chomp.split(' ').map(&:to_i)
ans = 0

n.times do |i|
  sum = 0
  j = 0
  as = gets.chomp.split(' ').map(&:to_i)
  as.each do |a|
    sum+=a*b[j]
    j+=1
  end
  ans += 1 if sum+c > 0
end
puts ans