N = int(input())
s = []
s_ = set([])
for i in range(N):
    tmp = input()
    s.append(tmp)
    s_.add(tmp)

M = int(input())
t = []
t_ = set([])
for j in range(M):
    tmp = input()
    t.append(tmp)
    t_.add(tmp)

u = s_.union(t_)

counter = []
for factor in u:
    counter.append(s.count(factor) - t.count(factor))

print(max(counter))