program answer
  implicit none
  integer :: i, j, N, M, C, ans, sum
  integer, allocatable :: B(:), A(:,:)
  read(*,*) N, M, C
  allocate(B(M))
  allocate(A(N,M))
  read(*,*) B
  do i = 1, N
     read(*,*) A(i,1:M)
  end do
  ans=0
  do i = 1, N
     sum=0
     do j = 1, M
        sum=sum+A(i,j)*B(j)
     end do
     sum=sum+C
     if(sum>0) then
        ans=ans+1
     end if
  end do
  write(*,*) ans
  deallocate(A,B)
  stop
 end program answer