n,m,c = map(int, input().split())
b = list(map(int, input().split()))
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
x = 0
for i in range(n):
    y = sum([p*q for p,q in zip(a[i],b)]) + c
    if y > 0:
        x += 1
print(x)