import Control.Monad

main :: IO ()
main = do
  [n, m, c] <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  ass <- replicateM n $ map read . words <$> getLine
  let calc a b = c + sum (zipWith (*) a b)
  print . length $ filter (>0) $ map (calc bs) ass
