import Control.Monad
main=do
 [n,m,c]<-map read.words<$>getLine
 b<-map read.words<$>getLine
 a<-replicateM n (map read.words<$>getLine)
 print(f n a b c 0)
  where f 0 _ _ _ i = i
        f n (v:a) b c i = f (n-1) a b c (i+(if(g v b)+c>0 then 1 else 0))
        g a b = (sum(map (\(a,b)->a*b) (zip a b)))