import numpy as np

ans = 0

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

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

for i in range(n):

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

    arrayA = np.array(a)

    arrayB = np.array(b)

    array = arrayA * arrayB

    if array.sum() + c > 0:

        ans += 1

    

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

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

ans = 0

for i in range(n):

    total = c

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

    for i in range(m):

        total += a[i] * b[i]

    if total > 0:

        ans += 1

print(ans)
import numpy as np

ans = 0
n, m, c = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
    a = list(map(int, input().split()))
    arrayA = np.array(a)
    arrayB = np.array(b)
    array = arrayA * arrayB
    if array.sum() + c > 0:
        ans += 1
print(ans)

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

-import numpy as np - -ans = 0 +ans = 0 +    total = c -    arrayA = np.array(a) -    arrayB = np.array(b) -    array = arrayA * arrayB -    if array.sum() + c > 0: +    for i in range(m): +        total += a[i] * b[i] +    if total > 0: