local N, M, C = io.read("n", "n", "n")
local B = {}
for i=1,M do
    table.insert(B, io.read("n"))
end
local ans = 0
for i=1,N do
    local score = C
    for j=1,M do
        score = score + io.read("n") * B[j]
    end
    if score > 0 then
        ans = ans + 1
    end
end
print(ans)
