n,m,c = gets.chomp.split(' ').map(&:to_i)
b_arr = gets.chomp.split(' ').map(&:to_i)
ans = 0
k = 1
while k <= n
  a_arr = gets.chomp.split(' ').map(&:to_i)
  i = 0
  sum = 0
  while i < m
    sum += a_arr[i] * b_arr[i]
    i += 1
  end
  sum += c
  if sum > 0
    ans += 1
  end
  k += 1
end
puts ans