import Control.Monad
main = do
  [n,m,c] <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  ass <- replicateM n (map read . words <$> getLine)
  print . length . filter (>0) $ map (\as -> sum (zipWith (*) bs as) + c) ass