a=int(input()) W=list(map(int,input().split())) b=int(input()) B=list(map(int,input().split())) W=[(w,0) for w in W] B=[(b,1) for b in B] A=W+B A.sort() ANS=0 now0=-10 now=0 for i in range(len(A)): if A[i][0]!=now0 and A[i][1]!=now: ANS+=1 now^=1 now0=A[i][0] ANS2=0 now0=-10 now=1 for i in range(len(A)): if A[i][0]!=now0 and A[i][1]!=now: ANS2+=1 now^=1 now0=A[i][0] print(min(ANS,ANS2))