from collections import Counter

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()))



ans = []



cs = Counter(s)

ct = Counter(t)



for i in range(len(cs)):

        ans.append(cs.most_common()[i][1] - t.count(cs.most_common()[i][0]))

print((max(max(ans), 0)))
# x1, y1, x2, y2 = map(int, input().split())



n = int(eval(input()))

s = []

for i in range(n):

    s.append(eval(input()))



m = int(eval(input()))

t = []

for i in range(m):

    t.append(eval(input()))



price = []

tmp = 0 

for i in range(n):

    price.append(s.count(s[i]) - t.count(s[i]))



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

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()))
ans = []
cs = Counter(s)
ct = Counter(t)
for i in range(len(cs)):
    ans.append(cs.most_common()[i][1] - t.count(cs.most_common()[i][0]))
print((max(max(ans), 0)))

# x1, y1, x2, y2 = map(int, input().split())
n = int(eval(input()))
s = []
for i in range(n):
    s.append(eval(input()))
m = int(eval(input()))
t = []
for i in range(m):
    t.append(eval(input()))
price = []
tmp = 0
for i in range(n):
    price.append(s.count(s[i]) - t.count(s[i]))
print((max(0, max(price))))

-from collections import Counter - +# x1, y1, x2, y2 = map(int, input().split()) -for _ in range(n): +for i in range(n): -for _ in range(m): +for i in range(m): -ans = [] -cs = Counter(s) -ct = Counter(t) -for i in range(len(cs)): -    ans.append(cs.most_common()[i][1] - t.count(cs.most_common()[i][0])) -print((max(max(ans), 0))) +price = [] +tmp = 0 +for i in range(n): +    price.append(s.count(s[i]) - t.count(s[i])) +print((max(0, max(price))))