import Control.Monad

main :: IO ()
main = do
  [n,m,c] <- map read . words <$> getLine
  bs <- map read . words <$> getLine
  ds <- replicateM n getLine
  print $ length $ filter (>0) $ map (f c bs) $ map (map read) $ map words ds

f :: Int -> [Int] -> [Int] -> Int
f c bs ds = sum (zipWith (*) bs ds) + c