import Control.Monad
import Data.List

main = do
  [n, m, c] <- map read . words <$> getLine
  b <- (map read . words) <$> getLine
  as <- replicateM n (map read . words <$> getLine)
  print $ length $ filter (>0) $ map (func c b) as

func :: Int -> [Int] -> [Int] -> Int
func c b x = c + (foldr (+) 0 $ zipWith (*) b x )