n = int(input()) W = sorted(list(map(int,input().split())),reverse=True) n = int(input()) B = sorted(list(map(int,input().split())),reverse=True) S = [[w,0] for w in W] + [[b,1] for b in B] S = sorted(S,reverse=True) now = 100 w = 0 b = 0 for l,i in S: if (w+b)%2 == 0: if i == 0 and l < now: now = l w += 1 else: if i == 1 and l < now: now = l b += 1 ans = (w+b) now = 100 w = 0 b = 0 for l,i in S: if (w+b)%2 == 0: if i == 1 and l < now: now = l b += 1 else: if i == 0 and l < now: now = l w += 1 print(max(ans,w+b))