{
TASK:round
LANG:Pascal
}
Program round;
 var br,a,b,u,d,n,i:longint;
     up,down:array[1..2000] of longint;
     r:array[1..4000] of boolean;

Function calc(i,p:longint):longint;
var j,s:longint;
begin
 s:=0;
 if p=1 then begin
  for j:=1 to i do if r[j] then s:=s+1;
  if i<n+1 then a:=a+1 else b:=b+1;
  if s>a+b-s then s:=a+b-s;
  r[i]:=true;
 end;
 if p=2 then begin
  if i<n+1 then
   for j:=n downto i do if r[j] then s:=s+1;
  if i>n then
   for j:=n+1 to i do if r[j] then s:=s+1;
  if i<n+1 then a:=a+1 else b:=b+1;
  if s>a+b-s then s:=a+b-s;
  r[i]:=true;
 end;
 calc:=s;
end;

begin
 readln(n);
 a:=0; b:=0; br:=0;
 for i:=1 to n do
  read(up[i]); readln;
 for i:=1 to n do
  read(down[i]); readln;
 u:=0; d:=0;
 for i:=1 to n do begin
  u:=u+up[i]; d:=d+down[i];
 end;
 br:=abs(u-d);
 writeln(br);
end.
