Program ABC121A

integer n,m,c,i,j,x,w
integer,allocatable::a(:,:),b(:)

read(*,*) n,m,c
allocate(a(n,m))
allocate(b(m))
read(*,*) b
read(*,*) ((a(i,j),j=1,m),i=1,n)
x=0

do i=1,n
 w=c
 do j=1,m
  w=w+a(i,j)*b(j)
 end do
 if (w>0) then
  x=x+1
 end if
end do

write(*,*) x


stop
end