N=int(eval(input()))

ans=0

s=[]

t=[]

for i in range(N):

    s.append(eval(input()))

M=int(eval(input()))

for j in range(M):

    t.append(eval(input()))



s.sort()

t.sort()

for i in range(N-1):

    if s[i]!=s[i+1]:

        sf=s.count(s[i+1])

        tf=t.count(s[i+1])

        if sf>tf:

            temp=sf-tf

            if temp>ans:

                ans=temp

sf=s.count(s[0])

tf=t.count(s[0])

if sf>tf:

    temp=sf-tf

    if ans<temp:

        ans=temp

print(ans)

l={}

N=int(eval(input()))

for i in range(N):

    a=eval(input())

    if a in l:

        l[a]+=1

    else:

        l[a]=1

M=int(eval(input()))

for j in range(M):

    b=eval(input())

    if b in l:

        l[b]-=1



if max(l.values())<=0:

    print((0))

else:

    print((max(l.values())))

N = int(eval(input()))
ans = 0
s = []
t = []
for i in range(N):
    s.append(eval(input()))
M = int(eval(input()))
for j in range(M):
    t.append(eval(input()))
s.sort()
t.sort()
for i in range(N - 1):
    if s[i] != s[i + 1]:
        sf = s.count(s[i + 1])
        tf = t.count(s[i + 1])
        if sf > tf:
            temp = sf - tf
            if temp > ans:
                ans = temp
sf = s.count(s[0])
tf = t.count(s[0])
if sf > tf:
    temp = sf - tf
    if ans < temp:
        ans = temp
print(ans)

l = {}
N = int(eval(input()))
for i in range(N):
    a = eval(input())
    if a in l:
        l[a] += 1
    else:
        l[a] = 1
M = int(eval(input()))
for j in range(M):
    b = eval(input())
    if b in l:
        l[b] -= 1
if max(l.values()) <= 0:
    print((0))
else:
    print((max(l.values())))

+l = {} -ans = 0 -s = [] -t = [] -    s.append(eval(input())) +    a = eval(input()) +    if a in l: +        l[a] += 1 +    else: +        l[a] = 1 -    t.append(eval(input())) -s.sort() -t.sort() -for i in range(N - 1): -    if s[i] != s[i + 1]: -        sf = s.count(s[i + 1]) -        tf = t.count(s[i + 1]) -        if sf > tf: -            temp = sf - tf -            if temp > ans: -                ans = temp -sf = s.count(s[0]) -tf = t.count(s[0]) -if sf > tf: -    temp = sf - tf -    if ans < temp: -        ans = temp -print(ans) +    b = eval(input()) +    if b in l: +        l[b] -= 1 +if max(l.values()) <= 0: +    print((0)) +else: +    print((max(l.values())))