var
n,m,total,heng,shu,i:longint;
a,b:array[0..10000]of longint;
procedure sort(l,r: longint);
var
i,j,x,y: longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2];
repeat
while a[i]>x do
inc(i);
while x>a[j] do
dec(j);
if not(i>j) then
begin
y:=a[i];
a[i]:=a[j];
a[j]:=y;
y:=b[i];
b[i]:=b[j];
b[j]:=y;
inc(i);
j:=j-1;
end;
until i>j;
if l<j then
sort(l,j);
if i<r then
sort(i,r);
end;
begin
assign(input,'cut.in'); reset(input);
assign(output,'cut.out'); rewrite(output);
readln(n,m);
for i:=1 to n-1 do
begin
read(a[i]);
b[i]:=2;
end;
for i:=n to n+m-2 do
begin
read(a[i]);
b[i]:=1;
end;
sort(1,n+m-2);
heng:=1;
shu:=1;
for i:=1 to n+m-2 do
begin
if b[i]=1 then
begin
inc(total,a[i]*heng);
inc(shu);
end
else begin
inc(total,a[i]*shu);
inc(heng);
end;
end;
writeln(total);
close(input);
close(output);
end.