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

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

count = 0

for i in range(N):

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

    t = C

    for i in range(M):

        t += Ai[i] * Bi[i]

    if t > 0:

        count += 1

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

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

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



count = 0

for a in Ai:

    s = C

    for i in range(M):

        s += a[i] * Bi[i]

    if s > 0:

        count += 1

print(count)
N, M, C = list(map(int, input().split()))
Bi = list(map(int, input().split()))
count = 0
for i in range(N):
    Ai = list(map(int, input().split()))
    t = C
    for i in range(M):
        t += Ai[i] * Bi[i]
    if t > 0:
        count += 1
print(count)

N, M, C = list(map(int, input().split()))
Bi = list(map(int, input().split()))
Ai = [list(map(int, input().split())) for _ in range(N)]
count = 0
for a in Ai:
    s = C
    for i in range(M):
        s += a[i] * Bi[i]
    if s > 0:
        count += 1
print(count)

+Ai = [list(map(int, input().split())) for _ in range(N)] -for i in range(N): -    Ai = list(map(int, input().split())) -    t = C +for a in Ai: +    s = C -        t += Ai[i] * Bi[i] -    if t > 0: +        s += a[i] * Bi[i] +    if s > 0: