#coding: utf-8

import numpy as np

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

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

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

sum_ = np.array([np.sum(A[i] * B) + C for i in range(N)])

print((np.sum(sum_ > 0)))
#coding: utf-8

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

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

l = []

for i in range(N):

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

    l.append(sum(A[j] * B[j] for j in range(M)) + C > 0)

print((sum(l)))
# coding: utf-8
import numpy as np

N, M, C = list(map(int, input().split()))
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int, input().split())) for _ in range(N)])
sum_ = np.array([np.sum(A[i] * B) + C for i in range(N)])
print((np.sum(sum_ > 0)))

# coding: utf-8
N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
l = []
for i in range(N):
    A = list(map(int, input().split()))
    l.append(sum(A[j] * B[j] for j in range(M)) + C > 0)
print((sum(l)))

-import numpy as np - -B = np.array(list(map(int, input().split()))) -A = np.array([list(map(int, input().split())) for _ in range(N)]) -sum_ = np.array([np.sum(A[i] * B) + C for i in range(N)]) -print((np.sum(sum_ > 0))) +B = list(map(int, input().split())) +l = [] +for i in range(N): +    A = list(map(int, input().split())) +    l.append(sum(A[j] * B[j] for j in range(M)) + C > 0) +print((sum(l)))