wl = {}
N = int(input())
for n in range(N):
    w = input()
    if w in wl:
        wl[w] = wl[w]+1
    else:
        wl[w] = 1 
M = int(input())
for m in range(M):
    w = input()
    if w in wl:
        wl[w] = wl[w]-1
    else:
        wl[w] = -1

mc = ""
c = 0
for k, v in wl.items():
    if c < v:
        mc = k
        c = v

print(c)