N = int(eval(input()))

S = []

number = []

for i in range(N):

    s = eval(input())

    if s in S:

       number[S.index(s)] += 1

    else:

        number.append(1)

        S.append(s)

M = int(eval(input()))

for i in range(M):

    s = eval(input())

    if s in S:

        number[S.index(s)] -= 1



print((max(max(number),0)))
n=int(eval(input()))

s=[]

t=[]

ans=0

for i in range(n):

    s.append(eval(input()))

m=int(eval(input()))

for i in range(m):

    t.append(eval(input()))

for i in range(n):

    ans=max(ans,s.count(s[i])-t.count(s[i]))

print(ans)

N = int(eval(input()))
S = []
number = []
for i in range(N):
    s = eval(input())
    if s in S:
        number[S.index(s)] += 1
    else:
        number.append(1)
        S.append(s)
M = int(eval(input()))
for i in range(M):
    s = eval(input())
    if s in S:
        number[S.index(s)] -= 1
print((max(max(number), 0)))

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

-N = int(eval(input())) -S = [] -number = [] -for i in range(N): -    s = eval(input()) -    if s in S: -        number[S.index(s)] += 1 -    else: -        number.append(1) -        S.append(s) -M = int(eval(input())) -for i in range(M): -    s = eval(input()) -    if s in S: -        number[S.index(s)] -= 1 -print((max(max(number), 0))) +n = int(eval(input())) +s = [] +t = [] +ans = 0 +for i in range(n): +    s.append(eval(input())) +m = int(eval(input())) +for i in range(m): +    t.append(eval(input())) +for i in range(n): +    ans = max(ans, s.count(s[i]) - t.count(s[i])) +print(ans)