def f(y, z): x = 0 for i in range(1, len(l)): if l[i][0] < y and l[i][1] != z: x += 1 y = l[i][0] z = l[i][1] return x nw = int(input()) w = [[int(i), 'w'] for i in input().split()] nb = int(input()) b = [[int(i), 'b'] for i in input().split()] l = sorted(w + b)[::-1] if max(w) != max(b): y = l[0][0] z = l[0][1] x = f(y, z) else: y = max(w) z = 'w' x1 = f(y, z) y = max(b) z = 'b' x2 = f(y, z) x = max(x1, x2) print(x+1)