n,m,c=io.read("*n", "*n", "*n")
b={}
for i = 1, m do
    b[i] = io.read("*n")
end
cnt = 0
for j = 1, n do
    ans = c
    for i = 1, m do
        ans = ans + b[i] * io.read("*n")
    end
    if(0 < ans) then cnt = cnt + 1 end
end
print(cnt)