n, m, c = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
a = []
res = 0
n.times do |i|
  a[i] = gets.split.map(&:to_i) 
end
a.each_with_index do |e, i|
  ans = 0
  m.times do |j|
    ans += e[j] * b[j]
  end
  res += 1 if ans + c > 0
end
puts res