program main
	implicit none
	integer :: N, M, C
	integer, allocatable :: A(:, :), B(:)
	integer :: counter, i
	read(*, *) N, M, C
	allocate(A(1:N, 1:M), B(1:M))
	read(*, *) B
	do i = 1, N
		read(*, *) A(i, 1:M)
	end do
	B = MATMUL(A,B)+C
	counter = 0
	do i = 1, N
		if(B(i) > 0) then
			counter = counter + 1
		end if
	end do
	write(*, *) counter
end program main