program main
  implicit none
  integer :: n, m, c, i, num = 0
  integer, allocatable :: b(:), a(:)

  read *, n, m, c
  allocate (a(m), b(m))
  read *, b(:)

  do i = 1, n
    read *, a(:)
    if (dot_product(a, b) > -c) then
      num = num + 1
    end if
  enddo

  print '(i0)', num

end