from collections import Counter



n = int(eval(input()))

s = list(eval(input()) for _ in range(n))

m = int(eval(input()))

t = list(eval(input()) for _ in range(m))



res = Counter(s)

for i in range(m):

    if t[i] in res:

        res[t[i]] -= 1



ans = 0

for v in list(res.values()):

    ans = max(ans, v)



print(ans)
import sys

from collections import Counter

sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7





def resolve():

    n = int(eval(input()))

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

    m = int(eval(input()))

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



    D_S = Counter(S)

    D_T = Counter(T)

    res = 0

    for k, v in list(D_S.items()):

        cnt = v - D_T.get(k, 0)

        res = max(res, cnt)



    print(res)





if __name__ == '__main__':

    resolve()

from collections import Counter

n = int(eval(input()))
s = list(eval(input()) for _ in range(n))
m = int(eval(input()))
t = list(eval(input()) for _ in range(m))
res = Counter(s)
for i in range(m):
    if t[i] in res:
        res[t[i]] -= 1
ans = 0
for v in list(res.values()):
    ans = max(ans, v)
print(ans)

import sys
from collections import Counter

sys.setrecursionlimit(10**7)
f_inf = float("inf")
mod = 10**9 + 7


def resolve():
    n = int(eval(input()))
    S = [eval(input()) for _ in range(n)]
    m = int(eval(input()))
    T = [eval(input()) for _ in range(m)]
    D_S = Counter(S)
    D_T = Counter(T)
    res = 0
    for k, v in list(D_S.items()):
        cnt = v - D_T.get(k, 0)
        res = max(res, cnt)
    print(res)


if __name__ == "__main__":
    resolve()

+import sys -n = int(eval(input())) -s = list(eval(input()) for _ in range(n)) -m = int(eval(input())) -t = list(eval(input()) for _ in range(m)) -res = Counter(s) -for i in range(m): -    if t[i] in res: -        res[t[i]] -= 1 -ans = 0 -for v in list(res.values()): -    ans = max(ans, v) -print(ans) +sys.setrecursionlimit(10**7) +f_inf = float("inf") +mod = 10**9 + 7 + + +def resolve(): +    n = int(eval(input())) +    S = [eval(input()) for _ in range(n)] +    m = int(eval(input())) +    T = [eval(input()) for _ in range(m)] +    D_S = Counter(S) +    D_T = Counter(T) +    res = 0 +    for k, v in list(D_S.items()): +        cnt = v - D_T.get(k, 0) +        res = max(res, cnt) +    print(res) + + +if __name__ == "__main__": +    resolve()