program can_you_solve_this
  implicit none
  integer :: n, m, c, b(20), a(20), i, k
  read(*,*) n, m, c
  a = 0
  b = 0
  read(*,*) b(1:m)
  k = 0
  do i = 1, n
    read(*,*) a(1:m)
    if (sum(a(1:m)*b(1:m))+c.gt.0) k = k + 1
  end do
  write(*,'(i0)') k
end program can_you_solve_this