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