lx = list(map(int,input().split(" ")))

lb = list(map(int,input().split(" ")))

#la = [li[0]][li[1]]

la = []

cnt = 0



for i in range(0, lx[0]):

    tmp = lx[2]

    la.append(list(map(int,input().split(" "))))

    for j in range(0, lx[1]):

        tmp += la[i][j] * lb[j]

    if (tmp > 0):

        cnt += 1



print(cnt)
n, m, c = list(map(int, input().split()))

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

#la = [li[0]][li[1]]



cnt = 0



for i in range(n):

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

    tmp = c

    for j in range(0, m):

        tmp += a[j] * b[j]

    if (tmp > 0):

        cnt += 1



print(cnt)
lx = list(map(int, input().split(" ")))
lb = list(map(int, input().split(" ")))
# la = [li[0]][li[1]]
la = []
cnt = 0
for i in range(0, lx[0]):
    tmp = lx[2]
    la.append(list(map(int, input().split(" "))))
    for j in range(0, lx[1]):
        tmp += la[i][j] * lb[j]
    if tmp > 0:
        cnt += 1
print(cnt)

n, m, c = list(map(int, input().split()))
b = list(map(int, input().split()))
# la = [li[0]][li[1]]
cnt = 0
for i in range(n):
    a = list(map(int, input().split()))
    tmp = c
    for j in range(0, m):
        tmp += a[j] * b[j]
    if tmp > 0:
        cnt += 1
print(cnt)

-lx = list(map(int, input().split(" "))) -lb = list(map(int, input().split(" "))) +n, m, c = list(map(int, input().split())) +b = list(map(int, input().split())) -la = [] -for i in range(0, lx[0]): -    tmp = lx[2] -    la.append(list(map(int, input().split(" ")))) -    for j in range(0, lx[1]): -        tmp += la[i][j] * lb[j] +for i in range(n): +    a = list(map(int, input().split())) +    tmp = c +    for j in range(0, m): +        tmp += a[j] * b[j]