program main
	implicit none
    integer :: n, m, c
    integer :: a(m), b(m)
    integer :: ans, i, j
    read(*, *) n, m, c
    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.gt.0) ans = ans + 1
    enddo
stop
end program main