program abc121b
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,m,c,i,ans
    integer(int32), allocatable:: b(:), a(:,:)

    read*, n,m,c
    allocate(b(m))
    allocate(a(m,n))
    read*, b(:)
    do i=1,n
        read*, a(:,i)
    end do
    ans=0
    do i=1,n
        if (sum(a(:,i)*b(:))+c > 0)ans=ans+1
    end do
    print'(i0)', ans
end program abc121b