from collections import defaultdict



n = int(eval(input()))

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

m = int(eval(input()))

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



d = defaultdict(int)

for x in s:

    d[x] += 1

for x in t:

    d[x] -= 1

print((max(0, max(d.values()))))
n = int(eval(input()))

s = []

for _ in range(n): 

    s.append(eval(input()))

m = int(eval(input()))

t = []

for _ in range(m): 

    t.append(eval(input()))



a = 0

for x in list(set(s)):

    a = max(a, s.count(x) - t.count(x))



print(a)
from collections import defaultdict

n = int(eval(input()))
s = [eval(input()) for _ in range(n)]
m = int(eval(input()))
t = [eval(input()) for _ in range(m)]
d = defaultdict(int)
for x in s:
    d[x] += 1
for x in t:
    d[x] -= 1
print((max(0, max(d.values()))))

n = int(eval(input()))
s = []
for _ in range(n):
    s.append(eval(input()))
m = int(eval(input()))
t = []
for _ in range(m):
    t.append(eval(input()))
a = 0
for x in list(set(s)):
    a = max(a, s.count(x) - t.count(x))
print(a)

-from collections import defaultdict - -s = [eval(input()) for _ in range(n)] +s = [] +for _ in range(n): +    s.append(eval(input())) -t = [eval(input()) for _ in range(m)] -d = defaultdict(int) -for x in s: -    d[x] += 1 -for x in t: -    d[x] -= 1 -print((max(0, max(d.values())))) +t = [] +for _ in range(m): +    t.append(eval(input())) +a = 0 +for x in list(set(s)): +    a = max(a, s.count(x) - t.count(x)) +print(a)