import Control.Monad (replicateM)

main :: IO ()
main = do
  [n, m, c] <- fmap (map (read :: String -> Int) . words) $ getLine
  bs <- fmap (map (read :: String -> Int) . words) $ getLine
  ass <- fmap (map (map (read :: String -> Int) . words)) $ getNLine_ n
  print $ (length . filter (> 0) . map ((+ c) . sum . zipWith (*) bs)) ass
 
-- 複数行入力
getNLine_ :: Int -> IO [String]
getNLine_ n = replicateM n getLine