local w, h = io.read("*n", "*n")
local wuse, huse = 0, 0
local t = {}
local idx = {}
for i = 1, w + h do
  t[i] = io.read("*n")
  idx[i] = i
end
table.sort(idx, function(a, b) return t[a] < t[b] end)
local ret = 0
local rem = (w + 1) * (h + 1) - 1
for i = 1, w + h do
  local src = idx[i]
  if src <= w then
    local use = h + 1 - huse
    if rem < use then use = rem end
    ret = ret + use * t[src]
    wuse = wuse + 1
    rem = rem - use
  else
    local use = w + 1 - wuse
    if rem < use then use = rem end
    ret = ret + use * t[src]
    huse = huse + 1
    rem = rem - use
  end
  if rem == 0 then break end
end
print(ret)