import Control.Monad

main = do
    [n, m, c] <- map read . words <$> getLine
    b <- map read . words <$> getLine
    a <- map (map read . words) <$> replicateM n getLine
    putStrLn $ show $ length $ filter (>0) $ map (+c) $ map sum $ map (zipWith (*) b) a
