from collections import Counter

n =int(eval(input()))

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

m =int(eval(input()))

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

c = Counter(a)

d = Counter(b)

e = -100000

for i,j in c.most_common():

    e = max(j-d[i],e)

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

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

m =int(eval(input()))

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

l = set(a)

e = -100000

for i in l:

    e = max(e,a.count(i)-b.count(i))

print((max(e,0)))
from collections import Counter

n = int(eval(input()))
a = [eval(input()) for i in range(n)]
m = int(eval(input()))
b = [eval(input()) for i in range(m)]
c = Counter(a)
d = Counter(b)
e = -100000
for i, j in c.most_common():
    e = max(j - d[i], e)
print((max(e, 0)))

n = int(eval(input()))
a = [eval(input()) for i in range(n)]
m = int(eval(input()))
b = [eval(input()) for i in range(m)]
l = set(a)
e = -100000
for i in l:
    e = max(e, a.count(i) - b.count(i))
print((max(e, 0)))

-from collections import Counter - -c = Counter(a) -d = Counter(b) +l = set(a) -for i, j in c.most_common(): -    e = max(j - d[i], e) +for i in l: +    e = max(e, a.count(i) - b.count(i))