program main
  implicit none
  integer :: N,M
  integer,allocatable :: A(:,:)
  integer,allocatable :: B(:)
  integer,allocatable :: out(:)
  integer :: nans
  integer :: C
  integer :: i 
  read(*,*) N,M,C
  allocate(B(M))
  allocate(A(N,M))
  read(*,*) B(:)
  do i = 1,N
     read(*,*) A(i,:)
  end do
  allocate(out(N))
  out=matmul(A,B)
  nans=0
  do i = 1,N
     if (out(i)+C > 0) nans = nans + 1
  end do
  write(*,'(i0)') nans
  stop
end program main