import numpy as np

from operator import mul

from functools import reduce



N, M, C = [int(x) for x in input().split()]

B = np.array([int(x) for x in input().split()])

#A = np.array([[0]*M,N])

A = np.empty((N,M))



result = np.array([])

count = 0



for n in range(N):

    A[n] = [int(m) for m in input().split()]

    #result = A[n] * B

    if sum(A[n] * B)+C > 0:

        count +=1

print(count)

import numpy as np



N, M, C = [int(x) for x in input().split()]

B = np.array([int(x) for x in input().split()])

A = np.empty((N,M))



count = 0

for n in range(N):

    A[n] = [int(m) for m in input().split()]

    count = count + 1 if sum(A[n] * B)+C > 0 else count 

print(count)

import numpy as np
from operator import mul
from functools import reduce

N, M, C = [int(x) for x in input().split()]
B = np.array([int(x) for x in input().split()])
# A = np.array([[0]*M,N])
A = np.empty((N, M))
result = np.array([])
count = 0
for n in range(N):
    A[n] = [int(m) for m in input().split()]
    # result = A[n] * B
    if sum(A[n] * B) + C > 0:
        count += 1
print(count)

import numpy as np

N, M, C = [int(x) for x in input().split()]
B = np.array([int(x) for x in input().split()])
A = np.empty((N, M))
count = 0
for n in range(N):
    A[n] = [int(m) for m in input().split()]
    count = count + 1 if sum(A[n] * B) + C > 0 else count
print(count)

-from operator import mul -from functools import reduce -# A = np.array([[0]*M,N]) -result = np.array([]) -    # result = A[n] * B -    if sum(A[n] * B) + C > 0: -        count += 1 +    count = count + 1 if sum(A[n] * B) + C > 0 else count