import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  [n,m,c] <- map (read::String->Int) . words <$> getLine
  bs <- map (read::String->Int) . words <$> getLine
  as <- map (map (read::String->Int)) . map words . lines <$> getContents
  let result = map ((>0) .(+c) .sum .(zipWith(*)bs)) as
  print $ length $ filter (==True) result