n=int(eval(input()))

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

m = int(eval(input()))

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

l = [0]*n

for i in range(n):

    ans = 0

    for j in range(n):

        if s[i] == s[j]:

            ans += 1

    for k in range(m):

        if s[i] == t[k]:

            ans -= 1

    l[i] = ans

print((max(max(l), 0)))
N = int(eval(input()))

memo = {}

for i in range(N):

    s = eval(input())

    if s in memo:

        memo[s] += 1

    else:

        memo[s] = 1



M = int(eval(input()))

for i in range(M):

    t = eval(input())

    if t in memo:

        memo[t] -= 1

    else:

        memo[t] = -1



score = sorted(list(memo.items()), key=lambda x:-x[1])

print((max(score[0][1],0)))
n = int(eval(input()))
s = [eval(input()) for i in range(n)]
m = int(eval(input()))
t = [eval(input()) for i in range(m)]
l = [0] * n
for i in range(n):
    ans = 0
    for j in range(n):
        if s[i] == s[j]:
            ans += 1
    for k in range(m):
        if s[i] == t[k]:
            ans -= 1
    l[i] = ans
print((max(max(l), 0)))

N = int(eval(input()))
memo = {}
for i in range(N):
    s = eval(input())
    if s in memo:
        memo[s] += 1
    else:
        memo[s] = 1
M = int(eval(input()))
for i in range(M):
    t = eval(input())
    if t in memo:
        memo[t] -= 1
    else:
        memo[t] = -1
score = sorted(list(memo.items()), key=lambda x: -x[1])
print((max(score[0][1], 0)))

-n = int(eval(input())) -s = [eval(input()) for i in range(n)] -m = int(eval(input())) -t = [eval(input()) for i in range(m)] -l = [0] * n -for i in range(n): -    ans = 0 -    for j in range(n): -        if s[i] == s[j]: -            ans += 1 -    for k in range(m): -        if s[i] == t[k]: -            ans -= 1 -    l[i] = ans -print((max(max(l), 0))) +N = int(eval(input())) +memo = {} +for i in range(N): +    s = eval(input()) +    if s in memo: +        memo[s] += 1 +    else: +        memo[s] = 1 +M = int(eval(input())) +for i in range(M): +    t = eval(input()) +    if t in memo: +        memo[t] -= 1 +    else: +        memo[t] = -1 +score = sorted(list(memo.items()), key=lambda x: -x[1]) +print((max(score[0][1], 0)))