import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as C8

main :: IO ()
main = do
  [n,m,c] <- readInts
  bs <- readInts
  dss <- replicateM n readInts
  print $ length $ filter (>0) $ map (f c bs) dss
 
f :: Int -> [Int] -> [Int] -> Int
f c bs ds = sum (zipWith (*) bs ds) + c

readInts :: IO [Int]
readInts = map (fst . fromJust . C8.readInt) . C8.words <$> C8.getLine