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

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

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

ans = 0

for i in range(N):

  sum_n = 0

  for j in range(M):

    sum_n += A_[i][j]*B_[j]

  if sum_n+C > 0:

    ans += 1

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

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

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

count = 0

for n in range(N):

  cost = 0

  for m in range(M):

    cost += A[n][m]*B[m]

  if cost + C > 0:

    count += 1

print(count)
N, M, C = list(map(int, input().split()))
B_ = list(map(int, input().split()))
A_ = [list(map(int, input().split())) for i in range(N)]
ans = 0
for i in range(N):
    sum_n = 0
    for j in range(M):
        sum_n += A_[i][j] * B_[j]
    if sum_n + C > 0:
        ans += 1
print(ans)

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

-B_ = list(map(int, input().split())) -A_ = [list(map(int, input().split())) for i in range(N)] -ans = 0 -for i in range(N): -    sum_n = 0 -    for j in range(M): -        sum_n += A_[i][j] * B_[j] -    if sum_n + C > 0: -        ans += 1 -print(ans) +B = list(map(int, input().split())) +A = [list(map(int, input().split())) for _ in range(N)] +count = 0 +for n in range(N): +    cost = 0 +    for m in range(M): +        cost += A[n][m] * B[m] +    if cost + C > 0: +        count += 1 +print(count)