I=lambda:list(map(int,input().split()));n,m,c=I();*b,=I();print((sum(-c<sum(x*y for x,y in zip(I(),b))for _ in[0]*n)))
I=lambda:list(map(int,input().split()));n,m,c=I();*b,=I();print((eval('+(-c<sum(x*y for x,y in zip(I(),b)))'*n)))
I = lambda: list(map(int, input().split()))
n, m, c = I()
(*b,) = I()
print((sum(-c < sum(x * y for x, y in zip(I(), b)) for _ in [0] * n)))

I = lambda: list(map(int, input().split()))
n, m, c = I()
(*b,) = I()
print((eval("+(-c<sum(x*y for x,y in zip(I(),b)))" * n)))

-print((sum(-c < sum(x * y for x, y in zip(I(), b)) for _ in [0] * n))) +print((eval("+(-c<sum(x*y for x,y in zip(I(),b)))" * n)))