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
}
for _ in 0..<M {
    let t=readLine()!
    b[t]=(b[t] ?? 0)-1
}
print(max(b.max{$0.value<$1.value}!.value, 0))