const print = x => console.log(x)
const readline = require('readline')
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false,
})

let A, B, C

function solve(A, B, C) {
  if (A + B >= C) return true
  return false
}


const lines = []
rl.on('line', (line) => {
  lines.push(line)
})

rl.on('close', (line) => {
  let i = 0
  const N = parseInt(lines[i++])
  const S = {}
  for (let j = 0; j < N; ++j) {
    const v = lines[i++]
    S[v] = (S[v] || 0) + 1
  }
  const M = parseInt(lines[i++])
  const T = {}
  for (let j = 0; j < M; ++j) {
    const v = lines[i++]
    T[v] = (T[v] || 0) + 1
  }
  const keys = {}
  Object.keys(S).forEach(v => keys[v] = true)
  Object.keys(T).forEach(v => keys[v] = true)
  const ret = Math.max(...Object.keys(keys).map(k => (S[k] || 0) - (T[k] || 0)))
  console.log(ret)
})
