N=int(eval(input()))

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

M=int(eval(input()))

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

X=0

C=0

for i in range(N):

  A=list_s.count(list_s[i])

  B=list_t.count(list_s[i])

  if (A-B)>X:

    X=A-B

for i in range(M):

  A=list_s.count(list_t[i])

  B=list_t.count(list_t[i])

  if (A-B)>X:

    X=A-B



print(X)

  
N=int(eval(input()))

wordcount={}

for i in range(N):

  s=str(eval(input()))

  wordcount[s]=wordcount.get(s,0)+1

M=int(eval(input()))

for i in range(M):

  s=str(eval(input()))

  wordcount[s]=wordcount.get(s,0)-1

counter=list(wordcount.values())

f=max(counter)

if f>=0:

  print(f)

else:

  print((0))



N = int(eval(input()))
list_s = [str(eval(input())) for s in range(N)]
M = int(eval(input()))
list_t = [str(eval(input())) for t in range(M)]
X = 0
C = 0
for i in range(N):
    A = list_s.count(list_s[i])
    B = list_t.count(list_s[i])
    if (A - B) > X:
        X = A - B
for i in range(M):
    A = list_s.count(list_t[i])
    B = list_t.count(list_t[i])
    if (A - B) > X:
        X = A - B
print(X)

N = int(eval(input()))
wordcount = {}
for i in range(N):
    s = str(eval(input()))
    wordcount[s] = wordcount.get(s, 0) + 1
M = int(eval(input()))
for i in range(M):
    s = str(eval(input()))
    wordcount[s] = wordcount.get(s, 0) - 1
counter = list(wordcount.values())
f = max(counter)
if f >= 0:
    print(f)
else:
    print((0))

-list_s = [str(eval(input())) for s in range(N)] +wordcount = {} +for i in range(N): +    s = str(eval(input())) +    wordcount[s] = wordcount.get(s, 0) + 1 -list_t = [str(eval(input())) for t in range(M)] -X = 0 -C = 0 -for i in range(N): -    A = list_s.count(list_s[i]) -    B = list_t.count(list_s[i]) -    if (A - B) > X: -        X = A - B -    A = list_s.count(list_t[i]) -    B = list_t.count(list_t[i]) -    if (A - B) > X: -        X = A - B -print(X) +    s = str(eval(input())) +    wordcount[s] = wordcount.get(s, 0) - 1 +counter = list(wordcount.values()) +f = max(counter) +if f >= 0: +    print(f) +else: +    print((0))