n, _, c = list(map(int, input().split()))

bs = tuple(map(int, input().split()))



count = 0

for _ in range(n):

    if sum(x * y for x, y in zip(list(map(int, input().split())), bs)) + c > 0:

        count += 1



print(count)

from sys import stdin





def na():

    return list(map(int, stdin.readline().split()))





n, _, c = na()

bs = tuple(na())



cnt = 0

for _ in range(n):

    if sum(x * y for x, y in zip(na(), bs)) > -c:

        cnt += 1



print(cnt)

n, _, c = list(map(int, input().split()))
bs = tuple(map(int, input().split()))
count = 0
for _ in range(n):
    if sum(x * y for x, y in zip(list(map(int, input().split())), bs)) + c > 0:
        count += 1
print(count)

from sys import stdin


def na():
    return list(map(int, stdin.readline().split()))


n, _, c = na()
bs = tuple(na())
cnt = 0
for _ in range(n):
    if sum(x * y for x, y in zip(na(), bs)) > -c:
        cnt += 1
print(cnt)

-n, _, c = list(map(int, input().split())) -bs = tuple(map(int, input().split())) -count = 0 +from sys import stdin + + +def na(): +    return list(map(int, stdin.readline().split())) + + +n, _, c = na() +bs = tuple(na()) +cnt = 0 -    if sum(x * y for x, y in zip(list(map(int, input().split())), bs)) + c > 0: -        count += 1 -print(count) +    if sum(x * y for x, y in zip(na(), bs)) > -c: +        cnt += 1 +print(cnt)