function Main(input) {
  var inputs = input.split("\n");
  var n = parseInt(inputs[0], 10), m = parseInt(inputs[n + 1], 10);
  var obj = new Map([]);
  var s;
  for (var i = 1; i <= n; i++) {
    s = inputs[i];
    if (obj.has(s)) {
      obj.set(s, obj.get(s) + 1);
    } else {
      obj.set(s, 1)
    }
  }
  for (var i = n + 2; i <= n + 1 + m; i++) {
    s = inputs[i];
    if (obj.has(s)) {
      obj.set(s, obj.get(s) - 1);
    } else {
      obj.set(s, -1);
    }
  }
  var max = 0;
  for (var value of obj.values()) {
    max = value > max ? value:max;
  }
  console.log(max);
}

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