"use strict";

function main(input) {
  var inputs = input.split("\n");

  var N = parseInt(inputs[0], 10)
  var s = inputs.slice(1, N + 1);
  var M = parseInt(inputs[N + 1], 10);
  var t = inputs.slice(N + 2, N + 2 + M);

  var dic = {};
  s.forEach((v, i) => dic[v] = (dic[v] || 0) + 1);
  t.forEach((v, i) => dic[v] = (dic[v] || 0) - 1);

  var result = 0;
  for (var key in dic) {
    result = Math.max(result, dic[key]);
  }

  console.log(result);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
