import Control.Monad
import Control.Applicative
import Data.List


dproduct :: Int -> [Int] -> [Int] -> Int
dproduct c [] []  = c
dproduct c (b:rt) (a:tl) = a*b + dproduct c rt tl



main :: IO ()
main = do
  [n,m,c] <- map read . words <$> getLine :: IO [Int]
  blist <- map read . words <$> getLine :: IO [Int]
  allist <- replicateM n (map read . words <$> getLine :: IO [Int])
  let [a] = filter (>0) $ map (dproduct c blist) allist
  print a
