from collections import Counter

N = int(eval(input()))

s_counter = Counter([eval(input()) for _ in range(N)])

M = int(eval(input()))

t_counter = Counter([eval(input()) for _ in range(M)])

d = {}

for key, value in list(s_counter.items()):

  d[key] = [value]

for key, value in list(t_counter.items()):

  if key not in d:

    d[key] = [-value]

  else:

    d[key].append(-value)

result = 0

for value in list(d.values()):

  if sum(value) > result:

    result = sum(value)

print(result)

    

N = int(eval(input()))

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

M = int(eval(input()))

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

list = [s.count(i) - t.count(i) for i in set(s)]

print((max(0, *list)))
from collections import Counter

N = int(eval(input()))
s_counter = Counter([eval(input()) for _ in range(N)])
M = int(eval(input()))
t_counter = Counter([eval(input()) for _ in range(M)])
d = {}
for key, value in list(s_counter.items()):
    d[key] = [value]
for key, value in list(t_counter.items()):
    if key not in d:
        d[key] = [-value]
    else:
        d[key].append(-value)
result = 0
for value in list(d.values()):
    if sum(value) > result:
        result = sum(value)
print(result)

N = int(eval(input()))
s = [eval(input()) for _ in range(N)]
M = int(eval(input()))
t = [eval(input()) for _ in range(M)]
list = [s.count(i) - t.count(i) for i in set(s)]
print((max(0, *list)))

-from collections import Counter - -s_counter = Counter([eval(input()) for _ in range(N)]) +s = [eval(input()) for _ in range(N)] -t_counter = Counter([eval(input()) for _ in range(M)]) -d = {} -for key, value in list(s_counter.items()): -    d[key] = [value] -for key, value in list(t_counter.items()): -    if key not in d: -        d[key] = [-value] -    else: -        d[key].append(-value) -result = 0 -for value in list(d.values()): -    if sum(value) > result: -        result = sum(value) -print(result) +t = [eval(input()) for _ in range(M)] +list = [s.count(i) - t.count(i) for i in set(s)] +print((max(0, *list)))