N, M, C = gets.split().map(&:to_i)
b = gets.split().map(&:to_i)
count = 0

N.times do
    a = gets.split().map(&:to_i)
    count += 1 if (0..M-1).inject(0) {|result, i|result + a[i] * b[i] } + C > 0
end

p count
