var b=[String:Int]()
for _ in 0..<Int(readLine()!)!{
    let s=readLine()!
    b[s]=(b[s] ?? 0)+1
}
var r=[String:Int]()
for _ in 0..<Int(readLine()!)!{
    let t=readLine()!
    r[t]=(r[t] ?? 0)+1
}
var ans=0
for (s,_) in b{
    ans=max(b[s]!-(r[s] ?? 0),ans)
}
print(ans)