n = [input() for _ in range(int(input()))]
m = [input() for _ in range(int(input()))]
 
Vocab = list(set(n))
MAX = max(n.count(Vocab[i])-m.count(Vocab[i]) for i in range(len(Vocab)))
print(max(0,max))