import Control.Monad
import Data.List
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
  print $ solve c bs ds
 
-- solve :: Int -> [Int] -> [Int] -> Int
-- solve c bs ds = sum (zipWith (*) bs ds) + c

solve :: Int -> [Int] -> [[Int]] -> Int
solve c bs = foldl' f e
  where
    e = 0
    f n ds
      | sum (zipWith (*) bs ds) + c > 0 = n+1
      | otherwise = n

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