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

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

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



counter = 0



for x in range(N):

    all = C

    xlist = Alist[x]

    for j in range(M):

        all += Blist[j]*xlist[j]

    if all>0:

        counter += 1



print(counter)

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

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

ans = 0

for i in range(N):

    score = C

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

    for j in range(M):

        score += Alist[j]*Blist[j]

    if score > 0:

        ans += 1

print(ans)
N, M, C = list(map(int, input().split()))
Blist = list(map(int, input().split()))
Alist = [list(map(int, input().split())) for i in range(N)]
counter = 0
for x in range(N):
    all = C
    xlist = Alist[x]
    for j in range(M):
        all += Blist[j] * xlist[j]
    if all > 0:
        counter += 1
print(counter)

N, M, C = list(map(int, input().split()))
Blist = list(map(int, input().split()))
ans = 0
for i in range(N):
    score = C
    Alist = list(map(int, input().split()))
    for j in range(M):
        score += Alist[j] * Blist[j]
    if score > 0:
        ans += 1
print(ans)

-Alist = [list(map(int, input().split())) for i in range(N)] -counter = 0 -for x in range(N): -    all = C -    xlist = Alist[x] +ans = 0 +for i in range(N): +    score = C +    Alist = list(map(int, input().split())) -        all += Blist[j] * xlist[j] -    if all > 0: -        counter += 1 -print(counter) +        score += Alist[j] * Blist[j] +    if score > 0: +        ans += 1 +print(ans)