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

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

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