program main
	implicit none
    integer :: n, m, c
    integer, allocatable :: a(:), b(:)
    integer :: ans, judge, i, j
    read(*, *) n, m, c
    allocate(a(m)); allocate(b(m))
    read(*, *) (b(i), i = 1, m)
    ans = 0
    do j = 1, n
    	read(*, *) (a(i), i = 1, m)
        judge = 0
        do i = 1, m
        	judge = judge + a(i)*b(i)
        enddo
        if (judge + c.gt.0) ans = ans + 1
    enddo
    write(*, *) ans
deallocate(a); deallocate(b)
stop
end program main