n, m, c = gets.split.map(&:to_i)
bs = gets.split.map(&:to_i)
as = []
n.times do
  as << gets.split.map(&:to_i)
end
ans = 0
for i in 0..(n-1) do
  temp = c
  aa = as[i]
  for j in 0..(m-1) do
    temp += aa[j] * bs[j]
  end
  ans += 1 if temp > 0
end
puts ans