import Control.Applicative
import Control.Monad
import Data.List
import Data.Array

main = do
  [n, m, c] <- map (read::String -> Int) . words <$> getLine
  coef <- map (read::String -> Int) . words <$> getLine
  results <- forM [1..n] (\i -> do
    arr <- map (read::String -> Int) . words <$> getLine
    return $ sum . map (\(x, y) -> x * y) $ zip (1:arr) (c:coef))
  print $ length $ filter ((<) 0) results