Nw = int(input()) W = list(map(int, input().split())) W.sort() Nb = int(input()) B = list(map(int, input().split())) B.sort() from bisect import bisect_left answ = 0 x = 1 y = 21 while True: if x: x = 0 i = bisect_left(W, y) if i > 0: answ += 1 y = W[i - 1] else: break else: x = 1 i = bisect_left(B, y) if i > 0: answ += 1 y = B[i - 1] else: break ansb = 0 x = 0 y = 21 while True: if x: x = 0 i = bisect_left(W, y) if i > 0: ansb += 1 y = W[i - 1] else: break else: x = 1 i = bisect_left(B, y) if i > 0: ansb += 1 y = B[i - 1] else: break print(max(ansb, answ))