function Main(input) {
  input = input.trim().split('\n');
  N = parseInt(input[0], 10);
  BLUE = input.slice(1, N + 1);
  M = parseInt(input[N + 1]);
  RED = input.slice(N + 2);
  O = {};
  max = 0;
  BLUE.forEach(key => {
    if (typeof O[key] === 'undefined') O[key] = 0;
    O[key] += 1;
  })
  RED.forEach(key => {
    if (typeof O[key] === 'undefined') O[key] = 0;
    O[key] -= 1;
  })
  console.log(O);
  Object.keys(O).forEach(key => {
    max = Math.max(max, O[key]);
  })
  console.log(max);
}

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