n,m,c = gets.split(" ").map(&:to_i)
b = gets.split(" ").map(&:to_i)
a = []
while as = gets do
    as = as.split(" ").map(&:to_i)
    a.push(as)
end

i = 0
count = 0
while n-1 >= i do
    an = a[i]
    sum = 0
    bi = 0
    an.each do |a|
        sum = (a * b[bi]) + sum
        bi = bi + 1
    end
    count = count + 1 if (sum + c) > 0
    i = i + 1
end

puts count


