import Control.Applicative

main = do
  [n, m] <- map read . words<$> getLine
  xs <- map read . words <$> getLine
  ys <- map read . words <$> getLine
  putStr . sum $ [area x y x' y' | x <- xs, y <- ys, x' <- xs, y' <- ys]

area x y z w = abs ((x - z) * (y - w))
