import numpy as np



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

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

inputs = [

    np.array([int(i) for i in input().split()]) * B for _ in range(N)

]



ans = 0

for i in range(N):

    if C + sum(inputs[i]) > 0:

        ans += 1



print(ans)

import numpy as np



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

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

inputs = [

    sum(np.array([int(i) for i in input().split()]) * B) + C for _ in range(N)

]



print((sum([1 if inputs[i] > 0 else 0 for i in range(N)])))

import numpy as np

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

import numpy as np

N, M, C = list(map(int, input().split()))
B = np.array([int(i) for i in input().split()])
inputs = [sum(np.array([int(i) for i in input().split()]) * B) + C for _ in range(N)]
print((sum([1 if inputs[i] > 0 else 0 for i in range(N)])))

-inputs = [np.array([int(i) for i in input().split()]) * B for _ in range(N)] -ans = 0 -for i in range(N): -    if C + sum(inputs[i]) > 0: -        ans += 1 -print(ans) +inputs = [sum(np.array([int(i) for i in input().split()]) * B) + C for _ in range(N)] +print((sum([1 if inputs[i] > 0 else 0 for i in range(N)])))