program main
  implicit none
  integer :: n, m, c, i, res
  integer, allocatable :: b(:), ai(:)
  read (*, *) n, m, c
  allocate (b(m), ai(m))
  read (*, *) b(:)
  res = 0
  do i = 1, n
    read (*, *) ai(:)
    if (dot_product(ai, b) > -c) res = res + 1
  end do

  write (*, "(i0)") res
end program main
