function main(input) {
  var input = input.split("\n");
 
  var N = parseInt(input[0], 10)
  var s = input.slice(1, N + 1);
  var M = parseInt(input[N + 1], 10);
  var t = input.slice(N + 2, N + 2 + M);
 
  var array = {};
  s.map(
    function(value, index){ array[value] = (array[value] || 0) + 1}
  );
  t.map(
    function(value, index){ array[value] = (array[value] || 0) - 1}
  );
 
  var a = 0;
  for (var key in array) {
    a = Math.max(a, array[key]);
  }
 
  console.log(a);
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));