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):

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

  if sum(A*B)+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):

  ab=0

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

  for j in range(M):

    ab += A[j] * B[j]

  if ab + C > 0:

    ans+=1

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):
    A = np.array(list(map(int, input().split())))
    if sum(A * B) + 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):
    ab = 0
    A = list(map(int, input().split()))
    for j in range(M):
        ab += A[j] * B[j]
    if ab + C > 0:
        ans += 1
print(ans)

-import numpy as np - -B = np.array(list(map(int, input().split()))) +B = list(map(int, input().split())) -    A = np.array(list(map(int, input().split()))) -    if sum(A * B) + C > 0: +    ab = 0 +    A = list(map(int, input().split())) +    for j in range(M): +        ab += A[j] * B[j] +    if ab + C > 0: