program b_121
    implicit none
    integer :: N,M,C
    integer :: A, B(20)
    integer :: i,j, ans = 0, count = 0
    read(*,*) N,M,C

    do i =1,M
        read(*,*) B(i)
    end do

    do i = 1,N
        do j = 1,M
            read(*,*) A
            ans = ans + A*B(i)
        end do
        if((ans+C) > 0) then
            count = count + 1
        end if
        ans = 0
    end do

    write(*,*) count

    
end program b_121