import Control.Monad
import Data.List

main :: IO ()
main = do
  [w,h] <- map read . words <$> getLine
  ps <- replicateM w $ readLn
  qs <- replicateM h $ readLn
  let s = sort $ zip ps (repeat False) ++ zip qs (repeat True)
  print $ solve (fromIntegral w+1) (fromIntegral h+1) s

solve :: Integer -> Integer -> [(Integer,Bool)] -> Integer
solve w h [] = 0
solve w h ((c,False):s) = c*h + solve (w-1) h s
solve w h ((c,True):s) = c*w + solve w (h-1) s