module Main where

import Data.List
import Control.Monad

solve :: Int -> [Int] -> [[Int]] -> Int
solve c bs ass = length $ filter inner ass where
    inner :: [Int] ->Bool
    inner as = (>0) . (+c)  .sum $ zipWith (*) as bs

main = do
    [n, _, c] <-  fmap read . words <$> getLine
    bs <- fmap read . words <$> getLine
    ass <- replicateM n (fmap read . words <$> getLine)
    print $ solve c bs ass


