n,m,c = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
codes = []
n.times do |i|
  codes << gets.split.map(&:to_i)
end

cnt = 0
codes.each do |a|
  sum = 0
  m.times do |i|
    temp = a[i] * b[i]
    sum += temp
  end
  if sum + c > 0
    cnt += 1
  end
end

p cnt
