(N, M, C) = gets.split.map(&:to_i)
B = gets.split.map(&:to_i)

a = []
N.times do
  a << gets.split.map(&:to_i)
end

result = 0

a.each do |data|
  p = 0
  data.each_with_index do |d, idx|
    p += d * B[idx]
  end
  if p + C > 0
    result += 1
  end
end

puts result