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

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

A = [0]*N

count = 0



def a_x_b(ab):

  a, b = ab

  return a*b



for n in range(N):

  A[n] = list(map(int, input().split()))

  AB = [(A[n][i], B[i]) for i in range(M)]

  if sum(list(map(a_x_b, AB)))+C > 0:

    count += 1

  else:

    continue

    

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

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

A = [0]*N

count = 0



for n in range(N):

  A[n] = list(map(int, input().split()))

  

  _sum = 0

  for i in range(M):

    _sum += A[n][i] * B[i]

    

  if _sum + C > 0:

    count += 1

  else:

    continue

    

print(count)

N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [0] * N
count = 0


def a_x_b(ab):
    a, b = ab
    return a * b


for n in range(N):
    A[n] = list(map(int, input().split()))
    AB = [(A[n][i], B[i]) for i in range(M)]
    if sum(list(map(a_x_b, AB))) + C > 0:
        count += 1
    else:
        continue
print(count)

N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = [0] * N
count = 0
for n in range(N):
    A[n] = list(map(int, input().split()))
    _sum = 0
    for i in range(M):
        _sum += A[n][i] * B[i]
    if _sum + C > 0:
        count += 1
    else:
        continue
print(count)

- - -def a_x_b(ab): -    a, b = ab -    return a * b - - -    AB = [(A[n][i], B[i]) for i in range(M)] -    if sum(list(map(a_x_b, AB))) + C > 0: +    _sum = 0 +    for i in range(M): +        _sum += A[n][i] * B[i] +    if _sum + C > 0: