program main 
implicit none

integer :: n,m,c
integer :: i,j,sm,cnt=0;
integer,allocatable :: a(:,:),b(:)
read(*,*)n,m,c
allocate(a(n,m),b(m))

read(*,*)b(1:m)
do i=1,n
	read(*,*)a(i,1:m)
end do
do i=1,n
	sm=0;
	do j=1,m
        sm = sm + a(i,j)*b(j)
    end do
    if (sm+c > 0) then 
    	cnt = cnt +1
    end if
end do

write(*,'(i0)')cnt

end program