n = int(eval(input()))

c = []

for i in range(n):

    c.append(eval(input()))

d = []

m = int(eval(input()))

for i in range(m):

    d.append(eval(input()))



scores = []

for i in c:

    score = 0

    for j in range(n):

        if i == c[j]:

            score += 1

    for j in range(m):

        if i == d[j]:

            score -= 1

    scores.append(score)

if max(scores) >= 0:

    print((max(scores)))

else:

    print((0))
n = int(eval(input()))

s = [eval(input()) for _ in range(n)]

m = int(eval(input()))

t = [eval(input()) for _ in range(m)]

counts =0

max1 = 0

for i in set(s):

  counts = s.count(i) - t.count(i)

  max1 = max(max1,counts)

print(max1)
n = int(eval(input()))
c = []
for i in range(n):
    c.append(eval(input()))
d = []
m = int(eval(input()))
for i in range(m):
    d.append(eval(input()))
scores = []
for i in c:
    score = 0
    for j in range(n):
        if i == c[j]:
            score += 1
    for j in range(m):
        if i == d[j]:
            score -= 1
    scores.append(score)
if max(scores) >= 0:
    print((max(scores)))
else:
    print((0))

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
m = int(eval(input()))
t = [eval(input()) for _ in range(m)]
counts = 0
max1 = 0
for i in set(s):
    counts = s.count(i) - t.count(i)
    max1 = max(max1, counts)
print(max1)

-c = [] -for i in range(n): -    c.append(eval(input())) -d = [] +s = [eval(input()) for _ in range(n)] -for i in range(m): -    d.append(eval(input())) -scores = [] -for i in c: -    score = 0 -    for j in range(n): -        if i == c[j]: -            score += 1 -    for j in range(m): -        if i == d[j]: -            score -= 1 -    scores.append(score) -if max(scores) >= 0: -    print((max(scores))) -else: -    print((0)) +t = [eval(input()) for _ in range(m)] +counts = 0 +max1 = 0 +for i in set(s): +    counts = s.count(i) - t.count(i) +    max1 = max(max1, counts) +print(max1)