program atcoder
implicit none
integer :: n,m,c,i,j,check
integer, allocatable :: a(:,:),b(:),ans(:)

read(*,*) n,m,c
allocate(a(n,m),b(m),ans(m))
ans = c

read(*,*) (b(i), i=1,m)

do i = 1,n
	read(*,*) (a(i,j), j=1,m)
end do

check = 0
do i = 1,n
	do j = 1,m
    	ans(i) = ans(i) + a(i,j)*b(j)
    end do
    if(ans(i)>0)then
    	check = check + 1
    end if
end do

write(*,'(i0)') check

end program atcoder