a,b:array[-100..100000]of longint;
i,j,n,m,h,t,k,p,s,l:longint;
begin
while true do
begin
read(n);
if n=0 then halt;
for i:=1 to n do
read(a[i]);
for i:=1 to n do
read(b[i]);
for i:=1 to n-1 do
for j:=n downto i+1 do
begin
if a[j-1]>a[j] then
begin
t:=a[j];
a[j]:=a[j-1];
a[j-1]:=t;
end;
if b[j-1]>b[j] then
begin
t:=b[j];
b[j]:=b[j-1];
b[j-1]:=t;
end;
end;
h:=0;
i:=1;
k:=1;
j:=n;
s:=j;
p:=0;
repeat
p:=p+1;
l:=0;
if (a[i]<b[k])and(l=0) then begin l:=1; h:=h-200; i:=i+1; j:=j-1; end;
if (a[i]>b[k])and(l=0) then begin l:=1; h:=h+200; i:=i+1; k:=k+1; end;
if (a[i]=b[k])and(l=0) then
begin
if (a[s]>b[j])and(l=0) then
begin
l:=1;
h:=h+200;
s:=s-1;
j:=j-1;
end;
if (a[s]<b[j])and(l=0) then
begin
l:=1;
h:=h-200;
i:=i+1;
j:=j-1;
end;
if (a[s]=b[j])and(l=0) then
begin
if (a[i]=b[j])and(l=0)then
begin
j:=j-1;
s:=s-1;
l:=1;
end;
if (a[i]<>b[j])and(l=0) then
begin
h:=h-200;
i:=i+1;
j:=j-1;
l:=1;
end;
end;
end;
until p=n;
writeln(h);
end;
end.