import Control.Monad
g b a c = if null a then c else (head b)*(head a)+g (tail b) (tail a) c
f :: [Int]->[[Int]]->Int->[Int]
f b a c = if null a then [] else (if (g b (head a) c)>0 then [1] else [0]) ++(f b (tail a) c)
main=do
 [n,m,c]<-map read.words<$>getLine
 b<-map read.words<$>getLine
 a<-map ((map read).words)<$>replicateM n getLine
 print$sum$f b a c