function main(input) {
  input = input.split("\r\n");
  const n = parseInt(input[0]);
  const s = input.slice(1,n+1);
  const m = parseInt(input[n+1]);
  const t = input.slice(n+2);
  const o = {};
  s.forEach(si => {
    if(!o[si]) o[si] = 0;
    o[si]++;
  });
  t.forEach(ti => {
    if(!o[ti]) o[ti] = 0;
    o[ti]--;
  });
  var max = 0;
  Object.keys(o).forEach(k => {
    max = Math.max(max, o[k]);
  });
  console.log(max);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));