import Foundation

var si: [String: Int] = [:]
var ti: [String: Int] = [:]
let n = Int(readLine()!)!
for _ in 0..<n {
  let s = readLine()!
  if si[s] != nil {
    si[s]! += 1
  } else {
    si[s] = 1
  }
}
let m = Int(readLine()!)!
for _ in 0..<m {
  let t = readLine()!
  if ti[t] != nil {
    ti[t]! += 1
  } else {
    ti[t] = 1
  }
}
var ans: [Int] = [0]
for k in si.keys {
  if ti[k] != nil {
    ans.append(si[k]! - ti[k]!)
  } else {
    ans.append(si[k]!)
  }
}
print(ans.max()!)