main = do
  (_:_:sC:_) <- words <$> getLine
  let c = (read sC) :: Integer
  bs <- map (read :: String-> Integer) <$> words <$> getLine
  aMat <- map (map read :: [String]-> [Integer]) <$> map words <$> lines <$> getContents
  let matMuled = map (\ aLine -> zipWith (*) aLine bs) aMat
  let aSum = map sum matMuled
  putStrLn $ show  $ length $ filter (\a -> a + c > 0) aSum
