import numpy as np

n,m,c = list(map(int, input().split()))

cond = list(map(int,input().split()))

char = []

for i in range(n):

    char.append(list(map(int, input().split())))

npcond = np.asarray(cond)

npchar = np.asarray(char)



npstat = npchar * npcond

npstat1 = np.sum(npstat, axis = 1) + c



print((np.count_nonzero(npstat1 > 0)))
n, m, c=list(map(int, input().split()))

b = list(map(int, input().split()))

a = []

for i in range(n):

    a.append(list(map(int, input().split())))



ab=0

ans=0

for i in range(n):

    for j in range(m):

        ab+=a[i][j]*b[j]

    if ab+c>0:

        ans+=1

        ab = 0

    else:

         ab = 0

print(ans)
import numpy as np

n, m, c = list(map(int, input().split()))
cond = list(map(int, input().split()))
char = []
for i in range(n):
    char.append(list(map(int, input().split())))
npcond = np.asarray(cond)
npchar = np.asarray(char)
npstat = npchar * npcond
npstat1 = np.sum(npstat, axis=1) + c
print((np.count_nonzero(npstat1 > 0)))

n, m, c = list(map(int, input().split()))
b = list(map(int, input().split()))
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
ab = 0
ans = 0
for i in range(n):
    for j in range(m):
        ab += a[i][j] * b[j]
    if ab + c > 0:
        ans += 1
        ab = 0
    else:
        ab = 0
print(ans)

-import numpy as np - -cond = list(map(int, input().split())) -char = [] +b = list(map(int, input().split())) +a = [] -    char.append(list(map(int, input().split()))) -npcond = np.asarray(cond) -npchar = np.asarray(char) -npstat = npchar * npcond -npstat1 = np.sum(npstat, axis=1) + c -print((np.count_nonzero(npstat1 > 0))) +    a.append(list(map(int, input().split()))) +ab = 0 +ans = 0 +for i in range(n): +    for j in range(m): +        ab += a[i][j] * b[j] +    if ab + c > 0: +        ans += 1 +        ab = 0 +    else: +        ab = 0 +print(ans)