import Control.Monad

main :: IO ()
main = do
  n:m:c:_ <- fmap (\x -> read x :: Int) <$> words <$> getLine
  bs <- fmap (\x -> read x :: Int) <$> words <$> getLine
  as <- replicateM n $ fmap (\x -> read x :: Int) <$> words <$> getLine
  print $ length $ [ s | s <- [sum (zipWith (*) a bs) | a <- as], (s + c) > 0]
