n = int(eval(input()))

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

D = {}

for s in S:

    if s in D:

        D[s] += 1

    else:

        D[s] = 1

m = int(eval(input()))

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

for t in T:

    if t in D:

        D[t] -= 1

D_sorted = sorted(list(D.items()), key=lambda x: x[1], reverse=True)

for k, v in D_sorted:

    print((max(0, v)))

    exit()
N = int(eval(input()))

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

M = int(eval(input()))

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

ans = 0

temp = set(S)

for i in temp:

    if S.count(i) - T.count(i) > ans:

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

print(ans)

n = int(eval(input()))
S = [eval(input()) for _ in range(n)]
D = {}
for s in S:
    if s in D:
        D[s] += 1
    else:
        D[s] = 1
m = int(eval(input()))
T = [eval(input()) for _ in range(m)]
for t in T:
    if t in D:
        D[t] -= 1
D_sorted = sorted(list(D.items()), key=lambda x: x[1], reverse=True)
for k, v in D_sorted:
    print((max(0, v)))
    exit()

N = int(eval(input()))
S = [eval(input()) for _ in range(N)]
M = int(eval(input()))
T = [eval(input()) for _ in range(M)]
ans = 0
temp = set(S)
for i in temp:
    if S.count(i) - T.count(i) > ans:
        ans = S.count(i) - T.count(i)
print(ans)

-n = int(eval(input())) -S = [eval(input()) for _ in range(n)] -D = {} -for s in S: -    if s in D: -        D[s] += 1 -    else: -        D[s] = 1 -m = int(eval(input())) -T = [eval(input()) for _ in range(m)] -for t in T: -    if t in D: -        D[t] -= 1 -D_sorted = sorted(list(D.items()), key=lambda x: x[1], reverse=True) -for k, v in D_sorted: -    print((max(0, v))) -    exit() +N = int(eval(input())) +S = [eval(input()) for _ in range(N)] +M = int(eval(input())) +T = [eval(input()) for _ in range(M)] +ans = 0 +temp = set(S) +for i in temp: +    if S.count(i) - T.count(i) > ans: +        ans = S.count(i) - T.count(i) +print(ans)