import collections



n=int(eval(input()))

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

m=int(eval(input()))

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



for i in range(len(lr)):

    if lr[i] in lb:

        lb.remove(lr[i])

    else:

        pass

if lb==[]:

    ans=0

else:

    s=collections.Counter(lb)

    ans=s.most_common()[0][1]      



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

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

m=int(eval(input()))

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



ans=[0]



for i in set(b):

    ans.append(b.count(i)-r.count(i))



print((max(ans)))
import collections

n = int(eval(input()))
lb = [eval(input()) for i in range(n)]
m = int(eval(input()))
lr = [eval(input()) for i in range(m)]
for i in range(len(lr)):
    if lr[i] in lb:
        lb.remove(lr[i])
    else:
        pass
if lb == []:
    ans = 0
else:
    s = collections.Counter(lb)
    ans = s.most_common()[0][1]
print(ans)

n = int(eval(input()))
b = [eval(input()) for i in range(n)]
m = int(eval(input()))
r = [eval(input()) for i in range(m)]
ans = [0]
for i in set(b):
    ans.append(b.count(i) - r.count(i))
print((max(ans)))

-import collections - -lb = [eval(input()) for i in range(n)] +b = [eval(input()) for i in range(n)] -lr = [eval(input()) for i in range(m)] -for i in range(len(lr)): -    if lr[i] in lb: -        lb.remove(lr[i]) -    else: -        pass -if lb == []: -    ans = 0 -else: -    s = collections.Counter(lb) -    ans = s.most_common()[0][1] -print(ans) +r = [eval(input()) for i in range(m)] +ans = [0] +for i in set(b): +    ans.append(b.count(i) - r.count(i)) +print((max(ans)))