INTEGER N,M,C
INTEGER,ALLOCATABLE,DIMENSION(:)::B,A
INTEGER ANS,CHIRASHINOURA
READ*,N,M,C
ALLOCATE(B(M))
ALLOCATE(A(M))
READ*,B
ANS=0
DO I=1,N
  READ*,A
  CHIRASHINOURA=C
  DO J=1,M
    CHIRASHINOURA=CHIRASHINOURA+A(J)*B(J)
  END DO
  IF(CHIRASHINOURA>0)ANS=ANS+1
END DO
PRINT"(I0)",ANS
END