import copy



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

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

As = []

for i in range(N):

    As.append(list(map(int, input().split())))



correct_answer_num = 0

for A in As:

    result = 0



    for j in range(M):

        result += A[j] * B[j]



    result += C

    if result > 0:

        correct_answer_num += 1



print(("{}".format(correct_answer_num)))

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

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

As = []

for i in range(N):

    As.append(list(map(int, input().split())))



correct_answer_num = 0

for A in As:

    result = 0



    for j in range(M):

        result += A[j] * B[j]



    result += C

    if result > 0:

        correct_answer_num += 1



print(("{}".format(correct_answer_num)))

import copy

N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
As = []
for i in range(N):
    As.append(list(map(int, input().split())))
correct_answer_num = 0
for A in As:
    result = 0
    for j in range(M):
        result += A[j] * B[j]
    result += C
    if result > 0:
        correct_answer_num += 1
print(("{}".format(correct_answer_num)))

N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
As = []
for i in range(N):
    As.append(list(map(int, input().split())))
correct_answer_num = 0
for A in As:
    result = 0
    for j in range(M):
        result += A[j] * B[j]
    result += C
    if result > 0:
        correct_answer_num += 1
print(("{}".format(correct_answer_num)))

-import copy -