import Text.Regex
import GHC.Exts

data PQ = P | Q deriving (Eq,Show)

main::IO()
main =do
  wh<-getLine
  let w:h:[]=map read (words wh)::[Int]
  ps<-get_n w
  qs<-get_n h
  let pp= map (\x->(P,x)) ps
  let qq= map (\x->(Q,x)) qs
  let pq= sortWith (\(_,x)->x) (pp++qq)
  print (solver w h pq)

get_n::Int -> IO [Int]
get_n 0 = return []
get_n n = do
          c<-getLine
          let m = read c ::Int
          rest<- (get_n (n-1))
          return (m:rest)

solver::Int -> Int -> [(PQ,Int)] -> Int
solver 0 0 [] = 0
solver w h ((P,p_i):rest) = ((h+1)*p_i)+(solver (w-1) h rest)
solver w h ((Q,q_j):rest) = ((w+1)*q_j)+(solver w (h-1) rest)