program bbb
implicit none

integer :: n, m, c, i, j, res1, res2
integer,allocatable,dimension(:,:) :: a
integer,allocatable,dimension(:) :: b

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

read*, b
do i=1,n
read*, a(:,i)
end do

res1=0

do i=1,n
 res2=0
 do j=1,m
 res2=res2+a(j,i)*b(j)
 end do
 if(res2+c>0) res1=res1+1
end do

write(*,'(i0)') res1

end program