1 type arr=array[0..150000] of longint;
2 var tmp,a,b:arr;
3 i,h1,h2,t1,t2,n,ans:longint;
4 procedure sort(var x:arr;h,l:longint);
5 var i,j,m,temp:longint;
6 begin
7 i:=h;j:=l;m:=x[(i+j)>>1];
8 repeat
9 while x[i]<m do inc(i);
10 while x[j]>m do dec(j);
11 if i<=j then
12 begin
13 temp:=x[i];x[i]:=x[j];x[j]:=temp;
14 inc(i);dec(j);
15 end;
16 until i>j;
17 if i<l then sort(x,i,l);
18 if j>h then sort(x,h,j);
19 end;
20 procedure init;
21 begin
22 readln(n);
23 for i:=1 to n do readln(a[i]);sort(a,1,n);
24 for i:=1 to n do readln(b[i]);sort(b,1,n);
25 end;
26 function get:longint;
27 begin
28 h1:=1;t1:=n;h2:=1;t2:=n;ans:=0;
29 while h1<=t1 do
30 if a[h1]>b[h2] then begin inc(ans,2);inc(h1);inc(h2);end
31 else if a[t1]>b[t2] then begin inc(ans,2);dec(t1);dec(t2);end
32 else
33 begin
34 if a[h1]=b[t2] then inc(ans,1);
35 dec(t2);inc(h1);
36 end;
37 exit(ans);
38 end;
39 procedure main;
40 begin
41 write(get,‘ ‘);
42 tmp:=a;a:=b;b:=tmp;
43 writeln(2*n-get);
44 end;
45 begin
46 init;
47 main;
48 end.