import Control.Monad
main = do
    [n, m, c] <- fmap read . words <$> getLine :: IO [Int]
    b <- fmap read . words <$> getLine :: IO [Int]
    a <- forM [1..n] . const $ fmap read . words <$> getLine :: IO [[Int]]
    print . length . filter (0<) $ flip fmap a $ sum . (c:) . zipWith (*) b
