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

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

alist = [list(map(int, input().split())) for _ in range(N)]



res = 0

for i in range(N):

    sum = 0

    for j in range(M):

        sum += alist[i][j] * blist[j]

    if sum + C > 0:

        res += 1

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

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

alist = [list(map(int, input().split())) for _ in range(N)]



print((sum([1 if sum(t[0]*t[1] for t in zip(alist[i], blist)) + C > 0 else 0 for i in range(N)])))
N, M, C = list(map(int, input().split()))
blist = list(map(int, input().split()))
alist = [list(map(int, input().split())) for _ in range(N)]
res = 0
for i in range(N):
    sum = 0
    for j in range(M):
        sum += alist[i][j] * blist[j]
    if sum + C > 0:
        res += 1
print(res)

N, M, C = list(map(int, input().split()))
blist = list(map(int, input().split()))
alist = [list(map(int, input().split())) for _ in range(N)]
print(
    (
        sum(
            [
                1 if sum(t[0] * t[1] for t in zip(alist[i], blist)) + C > 0 else 0
                for i in range(N)
            ]
        )
    )
)

-res = 0 -for i in range(N): -    sum = 0 -    for j in range(M): -        sum += alist[i][j] * blist[j] -    if sum + C > 0: -        res += 1 -print(res) +print( +    ( +        sum( +            [ +                1 if sum(t[0] * t[1] for t in zip(alist[i], blist)) + C > 0 else 0 +                for i in range(N) +            ] +        ) +    ) +)