program zzn;
var
i,j,m,n,ans,sn,sm:longint;
cm,cn:array[1..2000]of longint;
procedure swap(var a,b:longint);
var
t:longint;
begin
t:=a;
a:=b;
b:=t;
end;
procedure init;
begin
assign(input,'cut.in');
reset(input);
assign(output,'cut.out');
rewrite(output);
readln(n,m);
for i:=1 to n-1 do read(cn[i]);readln;
for i:=1 to m-1 do read(cm[i]);
for i:=1 to n-1 do
for j:=i+1 to n do if cn[i]<cn[j] then swap(cn[i],cn[j]);
for i:=1 to m-1 do
for j:=i+1 to m do if cm[i]<cm[j] then swap(cm[i],cm[j]);
end;
procedure closef;
begin
close(input);
close(output);
end;
procedure main;
begin
sn:=1;sm:=1;
ans:=0;
while true do
begin
if sn=n then
begin
for i:=sm to m-1 do
ans:=ans+cm[i]*sn;
break;
end;
if sm=m then
begin
for i:=sn to n-1 do
ans:=ans+cn[i]*sm;
break;
end;
if cm[sm]>cn[sn] then
begin
ans:=ans+cm[sm]*sn;
inc(sm);
end else
begin
ans:=ans+cn[sn]*sm;
inc(sn);
end;
end;
writeln(ans);
end;
begin
init;
main;
closef;
end.