import numpy as np

N, M, C = list(map(int, input().split()))

B = np.array(list(map(int, input().split())))



ans = 0



for i in range(N):

    tmp = np.dot(np.array(list(map(int, input().split()))), B)

    if (tmp.sum() + C) > 0:

        ans += 1



print(ans)

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

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

ans=0

sum1=0

for i in range(n):

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

    for j in range(m):

        sum1+=a[j]*b[j]

    if sum1+c>0:

        ans+=1

    sum1=0

print(ans)
import numpy as np

N, M, C = list(map(int, input().split()))
B = np.array(list(map(int, input().split())))
ans = 0
for i in range(N):
    tmp = np.dot(np.array(list(map(int, input().split()))), B)
    if (tmp.sum() + C) > 0:
        ans += 1
print(ans)

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

-import numpy as np - -N, M, C = list(map(int, input().split())) -B = np.array(list(map(int, input().split()))) +n, m, c = list(map(int, input().split())) +b = list(map(int, input().split())) -for i in range(N): -    tmp = np.dot(np.array(list(map(int, input().split()))), B) -    if (tmp.sum() + C) > 0: +sum1 = 0 +for i in range(n): +    a = list(map(int, input().split())) +    for j in range(m): +        sum1 += a[j] * b[j] +    if sum1 + c > 0: +    sum1 = 0