Nw = input() W = sorted(list(set(map(int, raw_input().split())))) Nb = input() B = sorted(list(set(map(int, raw_input().split())))) last = None ans = 0 while len(W) > 0 and len(B) > 0: if W[-1] == B[-1]: W.pop() B.pop() ans += 1 last = None elif W[-1] > B[-1]: W.pop() if last == 'B' or last == None: ans += 1 last = 'W' else: B.pop() if last == 'W' or last == None: ans += 1 last = 'B' if len(W) > 0 and (last == 'B' or last == None): print ans + 1 elif len(B) > 0 and (last == 'W' or last == None): print ans + 1 else: print ans