function getMax(blue, red) {
  var BLUE = {};
  var RED = {};
  max = 0;
  blue.forEach(keyword => {
    if (typeof BLUE[keyword] === "undefined") {
      BLUE[keyword] = 1;
    } else {
      BLUE[keyword] += 1;
    }
  });
  red.forEach(keyword => {
    if (typeof RED[keyword] === "undefined") {
      RED[keyword] = 1;
    } else {
      RED[keyword] += 1;
    }
  });
  Object.keys(BLUE).forEach(key => {
    if (typeof RED[key] === "undefined") {
      if (BLUE[key] > max) max = BLUE[key];
    }
    var tmp = (BLUE[key] - RED[key]) < 0 ? 0 : BLUE[key] - RED[key];
    if (tmp > max) max = tmp;
  })
  return max;
}

function Main(input) {
  input = input.split('\n');
  BLUE = input.slice(1, parseInt(input[0], 10) + 1);
  RED = input.slice(parseInt(input[0], 10) + 2, -1);
  console.log(getMax(BLUE, RED));
}

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