from collections import Counter

n = int(input())
s = []
for i in range(n):
    s.append(input())

m = int(input())
t = []
for i in range(m):
    t.append(input())

ls = Counter(s)
lt = Counter(t)

c = 0
for k in ls.keys():
    c_temp = ls[k] - lt[k]
    if c < c_temp:
        c = c_temp

print(c)
