1 #include<iostream>
2 #include<stdio.h>
3 #include<string.h>
4 #include<stdlib.h>
5 #include<math.h>
6 #include<string>
7 #include<algorithm>
8 using namespace std;
9 int n;
10 int a[100010],b[100010];
11
12 inline int read() {
13 int x=0,f=1;char ch;
14 ch=getchar();
15 while(ch>‘9‘||ch<‘0‘) {if(ch==‘-‘) f=-1; ch=getchar();}
16 while(ch<=‘9‘&&ch>=‘0‘) {x=(x<<1)+(x<<3)+ch-‘0‘;ch=getchar();}
17 return x*f;
18 }
19 int main() {
20 n=read();
21 for (int i=1;i<=n;++i) a[i]=read();
22 for (int i=1;i<=n;++i) b[i]=read();
23 sort(a+1,a+n+1);
24 sort(b+1,b+n+1);
25 int h1,h2,t1,t2,ans=0;
26 h1=h2=1;t1=t2=n;
27 while(h1<=t1) {
28 if (a[h1]>b[h2]) ans+=2,h1++,h2++;
29 else if (a[t1]>b[t2]) ans+=2,t1--,t2--;
30 else {
31 if (a[h1]==b[t2]) ans+=1;
32 h1++;t2--;
33 }
34 }
35 printf("%d",ans);
36 h1=h2=1;t1=t2=n;ans=2*n;
37 while(h1<=t1) {
38 if (b[h1]>a[h2]) ans-=2,h1++,h2++;
39 else if (b[t1]>a[t2]) ans-=2,t1--,t2--;
40 else {
41 if (b[h1]==a[t2]) ans-=1;
42 h1++;t2--;
43 }
44 }
45 printf(" %d",ans);
46 return 0;
47 }