N = int(eval(input()))

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

M = int(eval(input()))

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



Sw = list(set(S))

Tw = list(set(T))



mm = 0

for i in Sw:

    tmp = S.count(i) - T.count(i)

    if mm < tmp:

        mm = tmp



for i in Tw:

    tmp = S.count(i) - T.count(i)

    if mm < tmp:

        mm = tmp



print(mm)
N = int(eval(input()))

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

M = int(eval(input()))

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



red = {}

for i in T:

    if i not in red:

        red[i] = 1

    else:

        red[i] += 1



blue = {}

for i in S:

    if i not in blue:

        blue[i] = 1

    else:

        blue[i] += 1



res = 0

for i in set(S):

    if i not in red:

        tmp = blue[i]

    else:

        tmp = blue[i] - red[i]



    if res < tmp:

        res = tmp



print(res)

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
M = int(eval(input()))
T = [eval(input()) for _ in range(M)]
Sw = list(set(S))
Tw = list(set(T))
mm = 0
for i in Sw:
    tmp = S.count(i) - T.count(i)
    if mm < tmp:
        mm = tmp
for i in Tw:
    tmp = S.count(i) - T.count(i)
    if mm < tmp:
        mm = tmp
print(mm)

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
M = int(eval(input()))
T = [eval(input()) for _ in range(M)]
red = {}
for i in T:
    if i not in red:
        red[i] = 1
    else:
        red[i] += 1
blue = {}
for i in S:
    if i not in blue:
        blue[i] = 1
    else:
        blue[i] += 1
res = 0
for i in set(S):
    if i not in red:
        tmp = blue[i]
    else:
        tmp = blue[i] - red[i]
    if res < tmp:
        res = tmp
print(res)

-Sw = list(set(S)) -Tw = list(set(T)) -mm = 0 -for i in Sw: -    tmp = S.count(i) - T.count(i) -    if mm < tmp: -        mm = tmp -for i in Tw: -    tmp = S.count(i) - T.count(i) -    if mm < tmp: -        mm = tmp -print(mm) +red = {} +for i in T: +    if i not in red: +        red[i] = 1 +    else: +        red[i] += 1 +blue = {} +for i in S: +    if i not in blue: +        blue[i] = 1 +    else: +        blue[i] += 1 +res = 0 +for i in set(S): +    if i not in red: +        tmp = blue[i] +    else: +        tmp = blue[i] - red[i] +    if res < tmp: +        res = tmp +print(res)