import           Control.Monad

main :: IO ()
main = do
    [n, _, c] <- fmap (map read . words) getLine :: IO [Int]
    bs        <- fmap (map read . words) getLine :: IO [Int]
    ass       <- replicateM n $ fmap (map read . words) getLine :: IO [[Int]]
    print $ length $ filter (judge c bs) ass

judge :: Int -> [Int] -> [Int] -> Bool
judge c bs as = sum (zipWith (*) bs as) + c > 0
