n, m, c = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
as = []
n.times do
  as.push gets.split.map(&:to_i)
end
count = 0
as.each do |a|
  sum = c
  0.upto(m - 1) do |i|
    sum += a[i] * b[i]
  end
  count += 1 if sum > 0
end
puts count
