import Control.Monad
import Data.List

main = do
    [n,m,c] <- map read . words <$> getLine :: IO [Int]
    bs <- map read . words <$> getLine :: IO [Int]
    ass <- map ((map read) . words) . lines <$> getContents :: IO [[Int]]
    let ans = length . filter (> (-c)) $ map (sum . zipWith (*) bs) ass
    print ans