import Control.Applicative
import Control.Monad as M

main :: IO ()
main = do
  [n, m, c] <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  sources <- M.replicateM n $ map read . words <$> getLine
  putStrLn $ show (solve sources bs c)

solve :: [[Int]] -> [Int] -> Int -> Int
solve sources bs c = length $ filter (== True) $ map (calc bs c) sources

calc :: [Int] -> Int -> [Int] ->  Bool
calc bs c source
  | ((foldr (+) 0 $ zipWith (*) bs source) + c) > 0 = True
  | otherwise = False
