integer(8) :: n,m,c,ans=0,p
integer(8),allocatable,dimension(:) :: B,A
read*,n,m,c
allocate(B(m),A(m))
read(*,*)(B(i),i=1,m)
do i = 1,n
    read(*,*)(A(j),j=1,m)
    p = sum(A*B) + c
    if(p>0)then
        ans = ans + 1
    endif
enddo
write(*,'(i0)')ans
end