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 $ solve c bs ass

solve :: Int -> [Int] -> [[Int]] -> Int
solve c bs ass = length $ filter (judge c bs) ass

judge :: Int -> [Int] -> [Int] -> Bool
judge c bs as = prod bs as + c > 0

prod :: [Int] -> [Int] -> Int
prod bs as = sum $ zipWith (*) bs as
